← 返回 doordash 的题目列表Peak Hour Double Pay
类型:online_judge
Problem: Peak Hour Double Pay
On top of the previous rules (stackable vs. non-stackable waiting), you are also given peak-hour intervals. During peak hours, the per-minute rate becomes 2 * rate (or a configurable multiplier).
Given:
order events with ACCEPTED/ARRIVED/PICKED_UP/DELIVERED
base rate
m peak intervals [start_i, end_i)
Compute total pay.
Input (suggested)
n m rate
n lines of order events
m lines of peak intervals
Output
Total pay.
Example
Input
8 1 5
A 0 ACCEPTED
A 2 ARRIVED
A 6 PICKED_UP
A 10 DELIVERED
B 1 ACCEPTED
B 3 ARRIVED
B 4 PICKED_UP
B 7 DELIVERED
2 5
Output
75