← All problemsSign in

Under the Tunnels

CodeChefRating 2037Open on judge ↗

"All the pain in the world will not help you find something that does not exist..." You are Dastan, the great Prince of Persia! Under the tunnels of Alamut, you have discovered a path ― a sequence of $N$ tiles (numbered $1$ through $N$) ahead of you. You are currently on tile $1$. There is a signboard beside you, which says thus: - Stepping on tile $i$ (for each valid $i$) activates a switc

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