QOJ.ac

QOJ

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

#974. Cztery XOR

Statistiques

Dany jest ciąg $A_{1 \dots n}$ różnych liczb całkowitych. Należy sprawdzić, czy istnieją cztery indeksy $x, y, z, w$ takie, że $1 \le x < y < z < w \le n$ oraz $A_x \oplus A_y \oplus A_z \oplus A_w = 0$.

Przypomnijmy, że $x \oplus y$ oznacza bitową operację alternatywy wykluczającej (XOR) między $x$ oraz $y$.

Wejście

W pierwszej linii znajduje się pojedyncza liczba całkowita $n$ ($4 \le n \le 10^5$).

W drugiej linii znajduje się $n$ liczb całkowitych $A_{1 \dots n}$ ($0 \le A_i \le 10^5$). Gwarantuje się, że wszystkie $A_i$ są różne.

Wyjście

Wypisz „Yes”, jeśli istnieją cztery indeksy spełniające podane warunki, lub „No” w przeciwnym przypadku.

Przykład

Wejście 1

5
1 2 3 4 5

Wyjście 1

Yes

Wejście 2

5
1 2 4 8 16

Wyjście 2

No

Wejście 3

5
1 3 4 8 9

Wyjście 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.