Problem 859
Cookie Game
Odd and Even are playing a game with
The game begins with the
Odd’s turn: Odd may choose any pile with an odd number of cookies, eat one and divide the remaining (if any) into two equal piles.
Even’s turn: Even may choose any pile with an even number of cookies, eat two of them and divide the remaining (if any) into two equal piles.
The player that does not have a valid move loses the game.
Let
For example,
You are also given
Find
饼干游戏
小奇和小偶在玩一个游戏,需要用到
游戏开始时,将
轮到小奇时:小奇可以任选一堆有奇数块的饼干,吃掉一块,并将剩下的饼干(若有)分成相等的两堆。
轮到小偶时:小偶可以任选一堆有偶数块的饼干,吃掉两块,并将剩下的饼干(若有)分成相等的两堆。
首先无法行动的玩家输掉游戏。
记
例如,
已知
求
Gitalking ...