Yet Another Monsters Problem
There are $N$ monsters, with the $i$-th monster having $A_i$ hitpoints. A monster is said to be alive when he has a **positive number** of hitpoints. Your job is to kill all monsters. To do this, you can do either of the following $2$ actions: - Kill a monster completely in $1$ second, i.e. choose some monster $X$ who is alive and then reduce his hitpoints to $0$. - Damage all alive monsters by
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.
Sign in to chat with the tutor and save your progress.
Sign in to start