Kill Monsters (Hard Version)
**This is the hard version of the problem. Here, the values of $X$ and $K$ can go upto $10^9$, and $H_i$ can be as large as $10^{18}$.** In a video game, you are tasked with defeating monsters. The $i$-th monster has a health value of $H_i$. You start with an initial health value of $X$. You can defeat the $i$-th monster if your current health $X$ is **strictly greater than** the monster's h
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