← 返回 meta 的题目列表Battery Recharge Cycle
类型:online_judge
Given a set of battery capacities and each battery's recharge time, calculate how many batteries will be drained within given time t.
Input:
An integer array capacities, representing the capacity of each battery
An integer array recharge_time, representing the recharge time of each battery
An integer t representing the total time
Output:
An integer representing how many batteries will be fully used within time t
Example:
Input: capacities = [10, 20, 15], recharge_time = [2, 3, 4], t = 10
Output: 2
Explanation: Battery 10 will be used 5 times to drain its full capacity. The 20's battery will deplete in one go.
Data Scale:
The maximum length of the array is 1000, and t can be up to 1000.
Example
Input
capacities = [10, 20, 15], recharge_time = [2, 3, 4], t = 10