No.524 Coin Game
タグ : / 解いたユーザー数 254
作問者 :
hirakich1048576
/ テスター :
Problem Statement
You had a dream.
It was a dream in which your pet dog Chiwawa was kidnapped by the Demon King Yekocidur.
To save Chiwawa, you went through many adventures and finally defeated the Demon King Yekocidur.
However, he was defeated so easily that you felt suspicious, and as you searched for Chiwawa,
you found that Chiwawa had somehow ended up in a terrible state.
Next to Chiwawa are several plates with coins on them.
It seems that Chiwawa will return to normal if you win a game played with them.
The rules of this game are as follows.
- You move first and Chiwawa moves second, and you take coins alternately.
- You may take any number of coins at a time, but on each turn all of them must be taken from the same plate.
- You must always take at least 1 coin.
- A player whose turn comes when there are no coins left loses. The game ends, and the player who did not lose wins.
Given \(N\), determine whether you will win.
Here, both players always play optimally in order to win.
Input
N
The value of the integer N ( \( 0 < N < 2^{32}\) ) is given on one line.
Output
Print "O" if you win, or "X" if Chiwawa wins, on one line (without the quotation marks). Do not forget the newline at the end.
Sample
Sample 1
Input
3
Output
X
The numbers of coins on the plates are [1, 2, 3]. Unfortunately, in this case Chiwawa will not return to normal. Let us hope for a miracle.
Sample 2
Input
788
Output
O
Sample 3
Input
33554432
Output
O
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。