QOJ.ac

QOJ

حد الوقت: 1.0 s حد الذاكرة: 256 MB مجموع النقاط: 100

#11912. 两对英雄之战

الإحصائيات

在《魔兽争霸》游戏中,Alice 拥有两个英雄 $A_1$ 和 $A_2$,Bob 拥有两个英雄 $B_1$ 和 $B_2$。$A_1$ 和 $A_2$(分别为 $B_1$ 和 $B_2$)的生命值分别为 $a_1$ 和 $a_2$(分别为 $b_1$ 和 $b_2$)。生命值为正的英雄处于存活状态,生命值为零或负的英雄则死亡。游戏的目标是击杀对方的所有英雄。

Alice 和 Bob 轮流行动。在 Alice 的回合,如果 $A_1$(或 $A_2$)存活,则 $A_1$(或 $A_2$)可以减少 $B_1$ 的生命值 $a_{11}$(或 $a_{21}$),或者减少 $B_2$ 的生命值 $a_{12}$(或 $a_{22}$)。如果 $A_1$ 和 $A_2$ 都存活,则 Alice 的回合有 4 种可能的行动:

  • 减少 $B_1$ 的生命值 $a_{11} + a_{21}$;
  • 减少 $B_2$ 的生命值 $a_{12} + a_{22}$;
  • 减少 $B_1$ 的生命值 $a_{11}$ 并减少 $B_2$ 的生命值 $a_{22}$;
  • 减少 $B_1$ 的生命值 $a_{21}$ 并减少 $B_2$ 的生命值 $a_{12}$。

类似地,在 Bob 的回合,如果 $B_1$(或 $B_2$)存活,则 $B_1$(或 $B_2$)可以减少 $A_1$ 的生命值 $b_{11}$(或 $b_{21}$),或者减少 $A_2$ 的生命值 $b_{12}$(或 $b_{22}$)。如果 $B_1$ 和 $B_2$ 都存活,则 Bob 的回合有 4 种可能的行动:

  • 减少 $A_1$ 的生命值 $b_{11} + b_{21}$;
  • 减少 $A_2$ 的生命值 $b_{12} + b_{22}$;
  • 减少 $A_1$ 的生命值 $b_{11}$ 并减少 $A_2$ 的生命值 $b_{22}$;
  • 减少 $A_1$ 的生命值 $b_{21}$ 并减少 $A_2$ 的生命值 $b_{12}$。

双方均采取最优策略。你的任务是找出游戏的获胜者。

输入格式

第一行包含一个整数,表示测试用例的数量(最多 40 个)。 对于每个测试用例,包含一行 12 个整数 $a_1, a_2, b_1, b_2, a_{11}, a_{12}, a_{21}, a_{22}, b_{11}, b_{12}, b_{21}$ 和 $b_{22}$。所有整数均为正数且小于 100。

输出格式

对于每个测试用例,如果 Alice 即使在 Bob 先手的情况下也有必胜策略,则输出 “Alice wins”;如果 Bob 即使在 Alice 先手的情况下也有必胜策略,则输出 “Bob wins”;如果先手玩家有必胜策略,则输出 “It depends”。

样例

输入 1

3
3 3 3 8 1 2 2 1 2 1 1 2
4 10 10 4 1 2 2 1 2 1 1 2
5 12 12 5 2 1 1 2 1 2 2 1

输出 1

It depends
Alice wins
Bob wins

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.