luogu#P9283. [AGM 2023 资格赛] 棋子游戏
[AGM 2023 资格赛] 棋子游戏
Problem Description
Alice and Bob play a game on a grid.
There are pieces placed on different cells, and the pieces have various colors.
In each turn, a player may choose one piece, and move this piece together with the consecutive pieces after it that have different colors (i.e., all pieces before the next piece of the same color) to the left by a positive distance. During the movement, they must not cross over or overlap the cell immediately in front of them. Alice moves first, and the player who cannot make a move loses.
Then there are operations. Each operation is in one of the following forms:
1: Place a piece of color at position .
2: Remove the piece at position .
After each operation, output who wins under the current position.
Input Format
The first line contains two integers .
The next lines each contain two integers and , meaning there is initially a piece of color at position .
The next lines each contain two or three integers. The first is , indicating the operation type, followed by . If , then an additional integer is given.
Output Format
Output lines. Each line should be either Alice or Bob.
30 6
3 1
6 2
11 3
14 2
17 3
27 1
4
1 24 1
2 24
1 23 1
1 29 2
Bob
Alice
Alice
Bob
Hint
Translated by ChatGPT 5