#P4702. 取石子

    ID: 3509 远端评测题 2000ms 500MiB 尝试: 0 已通过: 0 难度: 1 上传者: 标签>O2优化进制前缀和位运算,按位洛谷月赛

取石子

Description

Alice and Bob are playing a game.

They have nn piles of stones, where the ii-th pile has aia_i stones, and initially it is guaranteed that aiai+1a_i \leq a_{i + 1} (1i<n1 \leq i < n). They take turns operating on the piles. In each move, a player may choose a pile that satisfies ai>ai1a_i > a_{i - 1} (with a0a_0 regarded as 00) 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(1n100)n (1 \leq n \leq 100), representing the number of piles.

The next line contains nn numbers, where the ii-th number is ai(1ai109)a_i (1 \leq a_i \leq 10^9), as defined above.

Output Format

"Alice" or "Bob", indicating who will win.

1
1
Alice
1
2
Bob

Hint

Translated by ChatGPT 5