PROJECT EULER · #0260
Stone Game
A game is played with three piles of stones and two players.
On each player's turn, the player may remove one or more stones from the piles. However, if the player takes stones from more than one pile, then the same number of stones must be removed from each of the selected piles.
In other words, the player chooses some
stones from any single pile; or stones from each of any two piles ( total); or stones from each of the three piles ( total).
The player taking the last stone(s) wins the game.
A winning configuration is one where the first player can force a win.
For example,
A losing configuration is one where the second player can force a win, no matter what the first player does.
For example,
Consider all losing configurations
We can verify that
Find
Write-up coming later
The complete problem is available here. An approach, code, and answer will be added later.