← All problemsSign in

Killing Monsters

CodeChefRating 2687Open on judge ↗

Chef is playing a game named "Killing monsters". In this game, at the beginning, there are n monsters arranged in a row (numbered 0 through n-1 from left to right). The i-th monster initially has hi health points. A monster dies if its health points become ≤ 0. Chef is going to perform q actions. For each action, Chef chooses two numbers x, y and shoots all living monsters whose index k satisfies

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start