Problem 882
Removing Bits
Dr. One and Dr. Zero are playing the following partisan game.
The game begins with one
Dr. One chooses a number and changes it by removing a
Dr. Zero chooses a number and changes it by removing a
The player that is unable to move loses.
Note that leading zeros are not allowed in any binary expansion; in particular nobody can make a move on the number
They soon realize that Dr. Zero can never win the game. In order to make it more interesting, Dr. Zero is allowed to “skip the turn” several times, i.e. passing the turn back to Dr. One without making a move.
For example, when
Let
For example,
Find
移除比特
壹博士和零博士正在玩一个游戏。
游戏开始时有一个
轮到壹博士行动时,壹博士可以选择一个数,并从其二进制表示中移除一个
轮到零博士行动时,零博士可以选择一个数,并从其二进制表示中移除一个
首先无法行动的玩家输掉游戏。
注意二进制表示中不允许有前导零;特别地,双方在行动时均不能选择数
他们很快意识到零博士永远不可能获胜。为了让这个游戏更有趣,零博士可以有限次地“跳过回合”,即不进行任何行动并将局面直接转交给壹博士。
例如,当
记
例如,
求
Gitalking ...