PROJECT EULER · #0900
DistribuNim II
Two players play a game with at least two piles of stones. The players alternately take stones from one or more piles, subject to:
- the total number of stones taken is equal to the size of the smallest pile before the move;
- the move cannot take all the stones from a pile.
The player that is unable to move loses.
For example, if the piles are of sizes 2, 2 and 4 then there are four possible moves.
Let
Define
Find
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.