← 返回 instacart 的题目列表Worker Management System
类型:online_judge
Implement a Worker Management System including the following features:
Add Worker: Requires input of worker's id, title, and salary.
Register Work Time: Input time and determine whether it's start or end time based on the worker's current office status.
Get: Retrieve the total office time for a worker.
Top N Functionality: Retrieve the top N workers based on total work time.
Promotion: Only occurs when the worker is out of office. If the worker is in office, the promotion request is queued until their next office entry, only the latest queued promotion is executed.
Calculate the total salary for a worker over a given time period.
Example
Input
1 Engineer 50\nregister_time 1 8\nregister_time 1 16\n
Output
Total Time: 8