Infinity Staircase
CodeChefOpen on judge ↗
You are climbing an infinity staircase, which (as its name suggests) has an infinite number of steps. You are currently standing at the $1$st step, and you would like to reach the $N$-th step. When standing at the $i$-th step, you can make one of the following three moves: - Move to step ${i+1}$ - Move to step ${i+2}$ - Move to step ${i+3}$ However, you can't make the same move twice in a row.
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