Time Limit: 2 sec / Memory Limit: 1024 MB
配点 : 600 点
問題文
長さ N の非負整数列 A=(A_1,A_2,\cdots,A_N) が与えられます. ここで,A の要素はすべて互いに異なります.
Alice と Bob がゲームをします. Alice からはじめて,二人は交互に手番をプレイします. 各手番では,プレイヤーは以下の操作を行います.
- 今 A の中で最も大きい要素を選び,それをより小さい別の非負整数で置き換える. ただし,操作後も A の要素はすべて互いに異なる必要がある.
先に操作を行えなくなった方の負けです. 両者が最適に行動した時,どちらが勝つか判定してください.
制約
- 2 \leq N \leq 3 \times 10^5
- 0 \leq A_1 < A_2 < \cdots < A_N \leq 10^9
- 入力される値はすべて整数
入力
入力は以下の形式で標準入力から与えられる.
N A_1 A_2 \cdots A_N
出力
Alice が勝つ場合は Alice
と,Bob が勝つ場合は Bob
と出力せよ.
入力例 1
2 2 4
出力例 1
Alice
初手で Alice が行える操作は,4 を 0,1,3 のいずれかで置き換えることです. 4 を 0 または 1 で置き換えたとすると,次の手番で Bob が行動したあと,Alice が行動不能になり,Alice の負けになります. 一方,4 を 3 で置き換えると,その後の Bob の行動に依らず,Alice が勝利できます. よって,この入力では Alice が勝利します.
入力例 2
3 0 1 2
出力例 2
Bob
Score : 600 points
Problem Statement
You are given a non-negative integer sequence of length N: A=(A_1,A_2,\cdots,A_N). Here, all elements of A are pairwise distinct.
Alice and Bob will play a game. They will alternately play a turn, with Alice going first. In each turn, the player does the operation below.
- Choose the largest element in A at the moment, and replace it with a smaller non-negative integer. Here, all elements in A must still be pairwise distinct after this operation.
The first player to be unable to do the operation loses. Determine the winner when both players play optimally.
Constraints
- 2 \leq N \leq 3 \times 10^5
- 0 \leq A_1 < A_2 < \cdots < A_N \leq 10^9
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
N A_1 A_2 \cdots A_N
Output
If Alice wins, print Alice
; if Bob wins, print Bob
.
Sample Input 1
2 2 4
Sample Output 1
Alice
In Alice's first turn, she may replace 4 with 0, 1, or 3. If she replaces 4 with 0 or 1, Bob's move in the next turn will make Alice unable to do the operation and lose. On the other hand, if she replaces 4 with 3, she can win regardless of Bob's subsequent moves. Thus, Alice wins in this input.
Sample Input 2
3 0 1 2
Sample Output 2
Bob