QOJ.ac

QOJ

Limite de temps : 1.0 s Limite de mémoire : 1024 MB Points totaux : 100

#14425. 棋盘上的游戏

Statistiques

在黑板上写有 $n$ 个不同的正整数 $a_1, \dots, a_n$。三名玩家按照 $1, 2, 3, 1, 2, 3, \dots$ 的顺序轮流进行操作。在一次操作中,玩家选择黑板上两个不同的数 $x$ 和 $y$,使得 $|x - y|$ 不在黑板上,并将 $|x - y|$ 写到黑板上($x$ 和 $y$ 仍保留在黑板上)。无法进行操作的玩家输掉游戏。玩家 2 和玩家 3 能否通过合作来迫使玩家 1 输掉游戏?

输入格式

第一行包含一个整数 $n$ ($1 \le n \le 10^5$),表示黑板上初始的整数个数。

第二行包含 $n$ 个互不相同的整数 $a_1, \dots, a_n$ ($1 \le a_i \le 10^9$),表示黑板上初始的数。

输出格式

如果玩家 2 和玩家 3 可以合作并迫使玩家 1 输掉游戏,则输出 "YES";否则输出 "NO"。

样例

输入样例 1

3
1 2 3

输出样例 1

YES

输入样例 2

3
1 4 3

输出样例 2

NO

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.