← All problemsSign in

Basic Tower Defence

CodeChefRating 2319Open on judge ↗

You are playing a tower defense game. Let $K$ denote the number of towers you have and $P$ denote the power of each tower. Initially, $K = 1$ and $P = 1$. The game has $N$ waves of enemies. The $i$-th wave contains $A_i$ enemies, each with $H_i$ health, and all these $A_i$ enemies must be defeated in **at most** $S_i$ turns to beat the wave. Each wave proceeds under the following rules: - Ev

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