201372: [AtCoder]ARC137 C - Distinct Numbers

Memory Limit:1024 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

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

Input

题意翻译

给定长为 $N$ 的非负整数列 $A=(A_1,\dots,A_N)$,保证 $A$ 中元素互不相同。 Alice 和 Bob 在玩游戏。Alice 为先手,两人轮流操作。每次操作选手可以如下进行: + 选择当前 $A$ 中最大的元素,将其替换为一个更小的非负整数。要求替换后 $A$ 中元素仍然互不相同。 首先无法操作的一方失败。当两人都采取最优策略时,求谁有必胜策略。 #### 输入格式 第一行一个正整数 $N$; 第二行 $N$ 个非负整数表示 $A_1,\dots,a_N$。 #### 输出格式 如果 Alice 有必胜策略则输出 `Alice`,如果 Bob 有必胜策略则输出 `Bob`。 #### 数据范围 + $2 \le N \le 3 \times 10^5$ + $0 \le A_1<A_2<\dots<A_N\le10^9$ #### 样例 1 解释 第一回合 Alice 可以将 $4$ 变为 $0,1,3$,如果 Alice 将 $4$ 变为 $0,1$ 中的一个,则 Bob 可以将 $2$ 变为 $0,1$ 中另一个,Alice 无法操作从而落败;如果 Alice 将 $4$ 变为 $3$,则此时 Bob 需要将 $3$ 变为 $0,1$ 中一个,同上知 Bob 必败。因此 Alice 有必胜策略。

加入题单

上一题 下一题 算法标签: