Time limit: 0.6s
Memory limit: 256MB
Input:
Output:
Task
You are given an integer , followed by positive integers, the -th number being . You are asked to find out the maximum xor sum you can get by choosing a continuous subarray.
A subarray is defined as the sequence that contains all values from the one to the one, and its xor sum is given as , where is the operator for XOR on bits.
Input data
The first line will contain the integer . The second line will contain integers.
Output data
The first line will contain the required answer.
Constraints and clarifications
- ,
# | Points | Constraints |
---|---|---|
1 | 20 | |
2 | 20 | |
3 | 60 | No additional constraints |
Example 1
stdin
6
0 1 2 3 5 4
stdout
6
Explanation
The subarray with the maximum xor sum is .
Example 2
stdin
10
1 2 100 12 3 0 12 4 0 1
stdout
107