QOJ.ac

QOJ

Time Limit: 1 s Memory Limit: 512 MB Total points: 100

#11828. 果仁蜜饼

Statistics

Baklava 是一种中东甜点,主要由千层酥皮、核桃和糖浆制成,切成小立方块,并装在包含多层的盒子里供应。

Alice 和 Bob 喜欢玩他们称之为“最后一块 Baklava”的游戏,规则如下:

  • 他们选择一个包含 $X \times Y \times Z$ 个 Baklava 小块的长方体来进行游戏。
  • 其中有 $N$ 个有毒的小块,双方都知道它们的位置。
  • Alice 先手,两人轮流操作。
  • 在每一轮中,玩家必须将长方体切成两个长方体,且其中至少有一个是安全的(不包含任何有毒的小块),并吃掉安全的那一部分。游戏在剩下的部分继续进行。
  • 切割沿着 $X$、$Y$ 或 $Z$ 轴进行。
  • 无法进行操作的玩家输掉游戏。

假设双方都采取最优策略,请问谁会赢得游戏?

下图是第一个测试用例的示例:

输入格式

程序将在一个或多个测试用例上进行测试。输入的第一行是一个整数 $T$,表示测试用例的数量 ($1 \le T \le 100$)。

每个测试用例以一行包含四个空格分隔的整数开始:

  • $X$:长方体的长度 ($1 \le X \le 1,000,000,000$)
  • $Y$:长方体的宽度 ($1 \le Y \le 1,000,000,000$)
  • $Z$:长方体的高度 ($1 \le Z \le 1,000,000,000$)
  • $N$:有毒小块的数量 ($0 \le N \le 100$)

随后有 $N$ 行,每行包含三个空格分隔的整数:

  • $x_i$:第 $i$ 个小块的 $x$ 坐标 ($1 \le x_i \le X$)
  • $y_i$:第 $i$ 个小块的 $y$ 坐标 ($1 \le y_i \le Y$)
  • $z_i$:第 $i$ 个小块的 $z$ 坐标 ($1 \le z_i \le Z$)

输出格式

对于每个测试用例,如果 Alice 获胜,打印一行 "Alice",否则打印 "Bob"。

样例

输入 1

2
3 3 3 4
3 2 1
3 1 1
3 3 1
3 2 2
5 5 5 1
3 4 2

输出 1

Alice
Bob

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.