← 返回 openai 的题目列表GPU Credit Management System
类型:online_judge
Suppose you need to design a GPU credit management system. Timestamps are unordered, meaning all the timestamps for adding and using credits are not strictly increasing. The system should cache all requests and, when querying the balance, backtrack to calculate the balance. There's no time complexity requirement, and a brute force solution is acceptable.
Example
Input
100
add 10
charge 5
balance