Stones of the Abyss
CodeChefOpen on judge ↗
Alice and Bob are playing a game with a single pile containing $N$ stones. They play alternating turns, and Alice always makes the first move. The rules of the game are as follows: * On her turn, Alice can remove any **odd** number of stones from the pile. * On his turn, Bob can remove any positive **even** number of stones from the pile. A player loses if they cannot make a valid move on their
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