Four XOR
Time limit1sMemory limit256 MB
Given n distinct integers, decide whether four of them can be chosen so that their bitwise XOR is zero.
- Level
Medium7 of 10
- Topics
- Bit manipulation, Brute force, Combinatorics, Hash map
- Solved
- No attempts yet
Problem
Given a sequence of distinct integers, determine whether there exist four indices such that and .
Here is the bitwise exclusive-or of and , sometimes written .
Input
The first line contains a single integer ().
The second line contains integers (). All are guaranteed to be distinct.
Output
Output "Yes" if four indices satisfying the conditions exist, or "No" otherwise.