QOJ.ac

QOJ

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

#974. Bốn XOR

统计

Cho một dãy số $A_{1 \dots n}$ gồm các số nguyên phân biệt, bạn cần trả lời xem có tồn tại bốn chỉ số $x, y, z, w$ sao cho $1 \le x < y < z < w \le n$ và $A_x \oplus A_y \oplus A_z \oplus A_w = 0$ hay không.

Nhắc lại rằng $x \oplus y$ là phép toán XOR (exclusive-or) giữa $x$ và $y$.

Dữ liệu vào

Dòng đầu tiên chứa một số nguyên $n$ ($4 \le n \le 10^5$).

Dòng thứ hai chứa $n$ số nguyên $A_{1 \dots n}$ ($0 \le A_i \le 10^5$). Đảm bảo rằng tất cả các $A_i$ đều phân biệt.

Dữ liệu ra

In ra "Yes" nếu tồn tại bốn chỉ số thỏa mãn các điều kiện, hoặc "No" trong trường hợp ngược lại.

Ví dụ

Dữ liệu vào 1

5
1 2 3 4 5

Dữ liệu ra 1

Yes

Dữ liệu vào 2

5
1 2 4 8 16

Dữ liệu ra 2

No

Dữ liệu vào 3

5
1 3 4 8 9

Dữ liệu ra 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.