#P10152. 「LAOI-5」拼图
「LAOI-5」拼图
Problem Description
Alice and Shinobu are playing a game. There are vertices, and each vertex is either black or white. Initially, every vertex is an isolated white vertex. Alice and Shinobu take turns to operate, and Alice moves first:
- In each round, Alice chooses a pair of vertices with no edge between them and adds an undirected edge . Self-loops are not allowed.
- In each round, Shinobu chooses one vertex and flips its color (black becomes white, white becomes black).
If, after some operation, there exists a monochromatic triangle in the graph (that is, there exist vertices such that have the same color and have all been added), or the opponent has no valid move, then the player who just operated wins. Assuming both players are perfectly smart, determine who has a winning strategy.
Input Format
This problem has multiple queries.
The first line contains a positive integer , the number of queries.
The next lines each contain a positive integer , the number of vertices in the game.
Output Format
Output lines, each containing Alice or Shinobu, indicating who will win in the end.
2
3
6
Shinobu
Alice
1
1000000000
Alice
Hint
Explanation of Sample :
For the -st test case, Alice will surely add after rounds. Shinobu can make black one by one.
For the -nd test case, Alice adds in rounds, and then Alice will surely win:
- Among , three vertices have the same color, so connect those three.
- have the same color, so connect to the one in that has the same color.
- have the same color, do the same as above.
- If have the same color, then must have the same color (the color has been flipped times, so the number of black vertices must be even). Therefore, must be the same color, so just connect them.
This problem uses bundled tests.
- Subtask 1 (10pts): .
- Subtask 2 (40pts): .
- Subtask 3 (50pts): no special restrictions.
For all testdata, , .
Translated by ChatGPT 5