#Q53. 「一本通 2.3 例 3」Nikitosh 和异或
「一本通 2.3 例 3」Nikitosh 和异或
Description
Original source: CODECHEF September Challenge 2015 REBXOR
Given an array of elements, indexed starting from 1. Find the maximum value of the following expression: $(A[l_1]\bigoplus A[l_1+1]\bigoplus …\bigoplus A[r_1])+ (A[l_2]\bigoplus A[l_2+1]^…\bigoplus A[r_2])$, where , and denotes the bitwise XOR of and .
Input Format
The first line of input contains an integer , representing the number of elements in the array.
The second line contains integers .
Output Format
Output a single line containing the maximum possible value of the given expression.
Sample 1
Valid pairs include: .
5
1 2 3 1 2
6
Constraints and Hints
For of the data, .