PROJECT EULER · #0629
Scatterstone Nim
Alice and Bob are playing a modified game of Nim called Scatterstone Nim, with Alice going first, alternating turns with Bob. The game begins with an arbitrary set of stone piles with a total number of stones equal to
During a player's turn, he/she must pick a pile having at least
If no valid move is possible on a given turn, then the other player wins the game.
A winning position is defined as a set of stone piles where a player can ultimately ensure victory no matter what the other player does.
Let
Let
Find
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.