P4702 Take Stones
Description
Alice and Bob are playing a game.
They have $n$ piles of stones, where the $i$-th pile has $a_i$ stones, and initially it is guaranteed that $a_i \leq a_{i + 1}$ ($1 \leq i < n$). They take turns operating on the piles. In each move, a player may choose a pile that satisfies $a_i > a_{i - 1}$ (with $a_0$ regarded as $0$) and remove one stone from it. The player who cannot make a move loses. Alice moves first, and they both play optimally. Determine who will win in the end.
Input Format
The first line contains an integer $n (1 \leq n \leq 100)$, representing the number of piles.
The next line contains $n$ numbers, where the $i$-th number is $a_i (1 \leq a_i \leq 10^9)$, as defined above.
Output Format
"Alice" or "Bob", indicating who will win.
Explanation/Hint
Translated by ChatGPT 5