Naman and Temple
CodeChefOpen on judge ↗
Naman has decided to go to a temple today. The path to this unique temple has exactly N steps with each step having a number A associated with it. The value of A-1 for a particular step denotes the maximum number of steps that one can skip and reach the Ath step from the current position. But in doing so, energy is reduced drastically. Suppose Naman goes from step J1 to step J2 and the numbers as
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