atcoder#ABC281F. [ABC281F] Xor Minimization
[ABC281F] Xor Minimization
Score : points
Problem Statement
You are given a sequence of non-negative integers .
Let us perform the following operation on just once.
- Choose a non-negative integer . Then, for every , replace the value of with the bitwise XOR of and .
Let be the maximum value in after the operation. Find the minimum possible value of .
What is bitwise XOR?
The bitwise XOR of non-negative integers A and B, A \oplus B, is defined as follows.- When A \oplus B is written in binary, the k-th lowest bit (k \geq 0) is 1 if exactly one of the k-th lowest bits of A and B is 1, and 0 otherwise.
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
3
12 18 11
16
If we do the operation with , the sequence becomes , where the maximum value is . We cannot make smaller than , so this value is the answer.
10
0 0 0 0 0 0 0 0 0 0
0
5
324097321 555675086 304655177 991244276 9980291
805306368