QOJ.ac

QOJ

时间限制: 1 s 内存限制: 256 MB 总分: 100

#974. Four XOR

统计

서로 다른 정수로 이루어진 수열 $A_{1 \dots n}$이 주어질 때, $1 \le x < y < z < w \le n$이면서 $A_x \oplus A_y \oplus A_z \oplus A_w = 0$을 만족하는 네 인덱스 $x, y, z, w$가 존재하는지 판별하시오.

$x \oplus y$는 $x$와 $y$ 사이의 비트 단위 배타적 논리합(bitwise exclusive-or)을 의미하며, 때때로 $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.