← All problemsSign in

Deputy Chef

CodeChefRating 1397Open on judge ↗

A battle is going to begin in the kingdom of Airland. There are $N$ soldiers in the kingdom, numbered $1$ through $N$ and standing in a circle in such a way that for each valid $i$, the soldier directly to the right of the $i$-th soldier is soldier $i+1$, and the soldier directly to the right of the $N$-th soldier is soldier $1$. Each soldier holds a sword and a shield. The sword is used to attac

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