Stair Game
There is a staircase consisting of n stairs, numbered 1,2,\ldots,n. Initially, each stair has some number of balls. There are two players who move alternately. On each move, a player chooses a stair k where k \neq 1 and it has at least one ball. Then, the player moves any number of balls from stair k to stair k-1. The player who moves last wins the game. Your task is to find out who wins the gam
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