QOJ.ac

QOJ

Límite de tiempo: 1.0 s Límite de memoria: 512 MB Puntuación total: 100 Hackeable ✓

#8145. GameX

Estadísticas

很久以前,有两位圣人,分别叫 St. Alice 和 St. Bob。

由于当圣人实在太无聊了,他们决定玩一个游戏。这个游戏与 MEX 运算有关,因此被命名为 GameX。

为了帮助你这个凡人理解这个游戏,我们首先给出 MEX 的定义。给定一个整数集合 $S$,定义 $\text{MEX}(S)$ 为不在 $S$ 中的最小自然数。换句话说,$\text{MEX}(S) = \min\{x \in \mathbb{N} \mid x \notin S\}$。

游戏过程如下: 游戏开始前,$S = \{a_1, a_2, \dots, a_n\}$,其中包含了生命、宇宙以及一切的终极秘密。 两位圣人轮流进行操作,St. Alice 先手。在每一轮操作中,玩家可以选择一个任意整数 $x$,并将其插入到 $S$ 中。因此,$S$ 更新为 $S \cup \{x\}$。 经过 $k$ 轮后,每位玩家各进行了 $k$ 次更新,现在是决定胜负的时候了。若 $\text{MEX}(S)$ 为偶数,则 St. Alice 获胜;否则 St. Bob 获胜。

圣人们非常聪明,因此他们都会采取最优策略。作为一个凡人,你能判断出谁会获胜吗?

输入格式

第一行包含一个正整数 $T$ ($1 \le T \le 10^4$),表示测试用例的数量。 对于每个测试用例: 第一行包含两个整数 $n, k$ ($1 \le n, k \le 2 \times 10^5$),分别表示游戏开始前 $S$ 的大小和游戏轮数。 下一行包含 $n$ 个不同的自然数 $a_1, a_2, \dots, a_n$ ($0 \le a_i \le 10^6$),表示集合 $S$。

保证 $\sum n, \sum k \le 2 \times 10^5$。

输出格式

对于每个测试用例,输出一行获胜者的名字。如果 St. Alice 获胜,输出 Alice,否则输出 Bob

样例

样例输入 1

5
14 5
7 13 1 6 14 2 16 17 18 19 34 36 20 23
13 5
8 10 3 13 14 15 16 17 18 19 20 36 38
14 5
14 20 12 6 0 16 8 11 9 17 13 3 5 19
14 5
15 7 13 3 1 17 16 14 0 12 4 10 22 53
14 5
7 3 4 0 14 15 16 17 18 19 20 21 22 23

样例输出 1

Bob
Bob
Alice
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.