QOJ.ac

QOJ

时间限制: 1 s 内存限制: 64 MB 总分: 100

#4386. 爱丽丝与鲍勃

统计

Alice 和 Bob 喜欢玩游戏。 黑板上写着 $m$ 个数字,所有数字均为 $0$ 到 $n$ 之间的整数。 游戏规则如下: 如果黑板上还有数字,且黑板上没有值为 $0$ 的数字,Alice 可以将黑板上剩余的数字分成两个集合。 Bob 选择其中一个集合并擦除该集合中的所有数字。然后将剩余的所有数字减 $1$。 在任何时候,如果黑板上出现了值为 $0$ 的数字,则 Alice 获胜;否则,如果黑板上所有的数字都被擦除,则 Bob 获胜。 请确定如果 Alice 和 Bob 都采取最优策略,谁将赢得游戏。

输入格式

第一行包含一个整数 $T(T \le 2000)$,表示测试用例的数量。 每个测试用例的第一行包含一个整数 $n(1 \le n \le 10^6)$。 每个测试用例的第二行包含 $n + 1$ 个整数 $a_0, a_1, a_2, \dots, a_n(0 \le a_i \le 10^6, \sum a_i = m)$,表示黑板上有 $a_i$ 个值为 $i$ 的数字。

输出格式

对于每个测试用例,如果 Alice 将赢得游戏,输出 "Alice",否则输出 "Bob"。

样例

输入 1

2
1
0 1
1
0 2

输出 1

Bob
Alice

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.