#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 ss is given.

  • In each move, choose a substring tt of ss. The substring tt must be one of 10, 100, 110, 1010. Then flip every character in tt. For example, flipping 100 becomes 001.

  • 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 ss containing only 00 and 11 (1s106)(1 \leq |s| \leq 10^6).

Output Format

If Alice wins, output Alice. If Bob wins, output Bob.

010
Alice
1111
Bob
1010
Bob
1010001011001
Alice

Hint

For sample 11, after choosing the substring 10 and flipping it, Bob cannot make a move.

Translated by ChatGPT 5