QOJ.ac

QOJ

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

#1356. 单人树游戏

统计

Whiteking 和 Blackking 准备玩一个关于长木板的棋子游戏。

在这个游戏中,你们使用 $N$ 块木板。第 $i$ 块木板的形状是一个二维条带:一个大小为 $1 \times A_i$ 的矩形。游戏开始时,所有木板的第一个格子各有一枚白棋,最后一个格子各有一枚黑棋。

每一回合,国王必须移动一枚属于他的棋子。移动时,国王必须将棋子移动到同一块木板上的另一个格子,但不能跳过对手的棋子,也不能移动到对手棋子所在的格子。国王轮流行动,无法移动的国王即为失败。

例如,如果一块长度为 6 的木板上,白棋在第 3 格,黑棋在第 5 格,那么白棋可以移动到第 1、2 或 4 格,黑棋可以移动到第 4 或 6 格。

假设国王们都采取最优策略,请确定游戏结果。

第一行包含一个整数 $N$ ($1 \le N \le 10^5$):长木板的数量。

第二行包含 $N$ 个整数 $A_1, A_2, A_3, \dots, A_N$ ($2 \le A_i \le 10^9$):长木板的长度。

第三行包含先手国王的名字:即 “Whiteking” 或 “Blackking”。

在第一行打印获胜国王的名字。注意首字母总是大写的。

样例

样例输入 1

2
3 3
Whiteking

样例输出 1

Blackking

样例输入 2

2
3 5
Whiteking

样例输出 2

Whiteking

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.