#P10737. [SEERC 2020] Reverse Game
[SEERC 2020] Reverse Game
Problem Description
Alice and Bob are playing a game with the following rules:
-
Before the game starts, a string is given.
-
In each move, choose a substring of . The substring must be one of
10,100,110,1010. Then flip every character in . For example, flipping100becomes001. -
The player who cannot make a move loses the game.
Alice moves first. Assuming both players use optimal strategies, determine who will win.
Input Format
A string containing only and .
Output Format
If Alice wins, output Alice. If Bob wins, output Bob.
010
Alice
1111
Bob
1010
Bob
1010001011001
Alice
Hint
For sample , after choosing the substring 10 and flipping it, Bob cannot make a move.
Translated by ChatGPT 5