QOJ.ac

QOJ

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

#974. Cuatro XOR

الإحصائيات

Dada una secuencia $A_{1 \dots n}$ de enteros distintos, debes responder si existen cuatro índices $x, y, z, w$ tales que $1 \le x < y < z < w \le n$ y $A_x \oplus A_y \oplus A_z \oplus A_w = 0$.

Recuerda que $x \oplus y$ significa el OR exclusivo a nivel de bits entre $x$ e $y$, a veces expresado como $x \text{ xor } y$.

Entrada

La primera línea contiene un único entero $n$ ($4 \le n \le 10^5$).

La segunda línea contiene $n$ enteros $A_{1 \dots n}$ ($0 \le A_i \le 10^5$). Se garantiza que todos los $A_i$ son distintos.

Salida

Imprime "Yes" si existen cuatro índices que satisfacen las condiciones, o "No" en caso contrario.

Ejemplos

Entrada 1

5
1 2 3 4 5

Salida 1

Yes

Entrada 2

5
1 2 4 8 16

Salida 2

No

Entrada 3

5
1 3 4 8 9

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