Maximum XOR of a Subset
Choose any subset (including empty) of the N values; print the maximum achievable XOR of the chosen elements.
Input: the first line has N; the second line has N non-negative integers.
Output: the maximum subset XOR.
Constraints:
- 1 ≤ N ≤ 105
- 0 ≤ ai < 260
Sample Tests
Input 1
3 1 2 3
Output 1
3
Input 2
2 8 8
Output 2
8
Discussion (opens after you solve — no spoilers before)
No comments yet.