← 返回 meta 的题目列表Battery Usage for Phone
类型:online_judge
Given a usage time t, a list of battery capacities, and a list of recharge times, calculate how many consecutive batteries are needed to complete the usage time t. Return -1 if all batteries are recharging. Steps: Find the next fully charged battery i, return -1 if none; check if it can complete the task, if it can, return used batteries count; otherwise, update current time and battery usage, and continue.
Example
Input
10
5 5 10
0 2 5