P11072 Alice and Bob
Description
Alice and Bob are playing a game together.
At the beginning, you are given an integer sequence $a$ with values in the range from $0$ to $n$. Then they take turns performing the following operation, with Alice moving first.
- Operation: arbitrarily rearrange $a_{1\sim a_1}$.
If, before a player's move, $a_1=0$, then that player loses immediately, because they cannot make a move.
If, after some move, a player has two of **their own** moves such that **after those moves** the resulting $a_1$ values are the same, then that player loses immediately.
Now you are given a non-negative integer sequence $a$. Assuming both players are smart enough, determine who has a winning strategy.
Input Format
**This problem has multiple test cases.**
The first line contains a positive integer $T$, the number of test cases.
Then follow $T$ test cases. For each test case, the first line contains a positive integer $n$, and the second line contains $n$ non-negative integers $a_i$.
Output Format
For each test case, output one line with a string `Alice` or `Bob`, indicating that the first player wins or the second player wins, respectively.
Explanation/Hint
| Test point ID $id$ | $n=$ | Special property |
| :----------: | :----------: | :----------: |
| $1\sim 20$ | $id$ | None |
| $21$ | $20$ | $a_1=0$ |
| $22$ | $20$ | $a_1=1$ |
| $23$ | $20$ | All $a_i$ are the same |
| $24\sim 25$ | $20$ | All $a_i$ are pairwise distinct |
For all testdata, it is guaranteed that $1\le T,n\le 20$, $0\le a_i\le n$.
Translated by ChatGPT 5