Glitch · Medium CodeFree
One Pair of Hands
One puppeteer, many acts on the schedule, each with its own time slot and applause. After every act, the puppeteer needs c seconds to change puppets. Which acts win the most applause?
Choose the acts that earn the most applause in total.
The programme must work and earn the most applause possible.
N c, the number of acts and the seconds needed to change puppets.N lines: s e w for acts 1 to N: the act runs on [s, e) and earns w.m, how many acts are performed.m act numbers, in performance order.N ≤ 30 000, 0 ≤ c ≤ 1 000 000s < e ≤ 10⁹, 1 ≤ w ≤ 10⁶; the total needs 64-bit numbers7 2 0 4 5 3 9 9 6 8 4 10 13 6 11 15 7 1 2 1 15 17 3
18 4 1 3 4 7
Sign in to play. It is free.
Sign in