QOJ.ac

QOJ

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

#974. Quatre XOR

Statistics

Étant donné une séquence $A_{1 \dots n}$ d'entiers distincts, vous devez déterminer s'il existe quatre indices $x, y, z, w$ tels que $1 \le x < y < z < w \le n$ et $A_x \oplus A_y \oplus A_z \oplus A_w = 0$.

Rappelons que $x \oplus y$ désigne le ou exclusif bit à bit entre $x$ et $y$, parfois exprimé sous la forme $x \text{ xor } y$.

Entrée

La première ligne contient un entier unique $n$ ($4 \le n \le 10^5$).

La deuxième ligne contient $n$ entiers $A_{1 \dots n}$ ($0 \le A_i \le 10^5$). Il est garanti que tous les $A_i$ sont distincts.

Sortie

Affichez « Yes » s'il existe quatre indices satisfaisant les conditions, ou « No » sinon.

Exemples

Entrée 1

5
1 2 3 4 5

Sortie 1

Yes

Entrée 2

5
1 2 4 8 16

Sortie 2

No

Entrée 3

5
1 3 4 8 9

Sortie 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.