QOJ.ac

QOJ

Limite de temps : 1 s Limite de mémoire : 256 MB Points totaux : 100

#974. Четыре XOR

Statistiques

Дана последовательность $A_{1 \dots n}$ из различных целых чисел. Вам необходимо определить, существуют ли четыре индекса $x, y, z, w$ такие, что $1 \le x < y < z < w \le n$ и $A_x \oplus A_y \oplus A_z \oplus A_w = 0$.

Напомним, что $x \oplus y$ означает побитовое исключающее ИЛИ между $x$ и $y$, иногда записываемое как $x \text{ xor } y$.

Входные данные

Первая строка содержит единственное целое число $n$ ($4 \le n \le 10^5$).

Вторая строка содержит $n$ целых чисел $A_{1 \dots n}$ ($0 \le A_i \le 10^5$). Гарантируется, что все $A_i$ различны.

Выходные данные

Выведите «Yes», если существуют четыре индекса, удовлетворяющие условиям, или «No» в противном случае.

Примеры

Входные данные 1

5
1 2 3 4 5

Выходные данные 1

Yes

Входные данные 2

5
1 2 4 8 16

Выходные данные 2

No

Входные данные 3

5
1 3 4 8 9

Выходные данные 3

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.