Problem 325
Stone Game II
A game is played with two piles of stones and two players.
On each player’s turn, the player may remove a number of stones from the larger pile.
The number of removed must be a positive multiple of the number of stones in the smaller pile.
E.g., let the ordered pair
The player taking all the stones from a pile 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,
Define
We can verify that
Find
取石子游戏(二)
两名玩家正在用两堆石子玩游戏。
每一轮,玩家可以从较大的堆中取走一定数量的石子。
移走石子的数量必须是较小的堆中石子数量的正整数倍。
例如,用有序对
从某一堆中取走所有石头的玩家赢得游戏。
所谓必胜态指先手玩家必胜的状态。例如
所谓必败态指无论先手玩家如何操作,后手玩家都必胜的状态。例如,
对于所有
可以验证
求
译注:“取石子游戏(一)”参见第260题。
Be the first person to leave a comment!