1414 Max Xor Sub-sequence
Submit solution
Points:
100
Time limit:
1.0s
Memory limit:
32M
Problem types
Allowed languages
C, C++, Java, Python
Description
Given is a sequence of integer numbers. You are to find a consecutive sub-sequence, which the xor value between all these numbers has the maximum value.
Input
There are multiple cases. For each case: Line 1: A single integer N(1<N<=100000) Followed N integers ranging from 0 to 1000,000.
Output
For each case output the maximum xor value in a single line.
Sample
Input
4
2 2 4 4
5
3 1 2 4 5
Output
6
7
Hint
6=2^4 ; 7=1^2^4 ;
Source: MoonLight
Comments