Problem 665
Proportionate Nim
Two players play a game with two piles of stones, alternating turns.
On each turn, the corresponding player chooses a positive integer
- removes
stones from one pile; - removes
stones from both piles; or - removes
stones from one pile and stones from the other pile.
The player who removes the last stone wins.
We denote by
Then, for example, if the position is
A position is a losing position if the player to move next cannot force a win. For example,
Let
You are given that
Find
等比例取石子游戏
两名玩家正在玩一个取石子游戏,这个游戏需要两堆石子,两名玩家交替行动。
在每一回合,轮到行动的玩家选择一个正整数
- 从一个堆中移除
个石子; - 从两个堆中各移除
个石子; - 从一个堆中移除
个石子,并从另一个堆中移除 个石子。
最终,移除最后一个石子的玩家获胜。
我们用
比如说,如果当前状态是
如果即将行动的玩家不能确保获胜,则称当前状态为必败态。例如,
对于所有满足
已知
求
Gitalking ...