시간 제한 | 메모리 제한 | 제출 | 정답 | 맞은 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 256 MB | 29 | 22 | 16 | 80.000% |
Given a sequence $A_{1...n}$ of distinct integers, you need to answer whether there exist four indices $x, y, z, w$ such that $1 \le x < y < z < w \le n$ and $A_x \oplus A_y \oplus A_z \oplus A_w = 0$.
Recall that $x \oplus y$ means the bitwise exclusive-or between $x$ and $y$, sometimes expressed as $x \mathrm{xor} y$.
The first line contains a single integer $n$ ($4 \le n \le 10^5$).
The second line contains $n$ integers $A_{1...n}$ ($0 \le A_i \le 10^5$). It is guaranteed that all $A_i$ are distinct.
Output "Yes
" if there are four indices satisfying the conditions, or "No
" otherwise.
5 1 2 3 4 5
Yes
5 1 2 4 8 16
No
5 1 3 4 8 9
No