#P7335. [JRKSJ R1] 异或
[JRKSJ R1] 异或
Problem Description
You are given , , and a sequence . Choose disjoint intervals , and compute
$$\max_{l_i,r_i}\sum_{i=1}^k\bigoplus_{j=l_i}^{r_i}a_j$$Here, denotes the bitwise XOR operation.
The testdata is guaranteed to be random.
Input Format
The input has lines.
The first line contains two integers .
The second line contains non-negative integers representing the sequence .
Output Format
Output one non-negative integer in one line, which is the maximum value of the expression.
6 3
2 1 3 4 4 4
15
7 2
3 4 5 6 7 8 9
24
Hint
Sample 1 Explanation
The three intervals chosen in the sequence are:
The sum of XOR values of the three intervals is .
Constraints
For all testdata, it is guaranteed that and . The testdata is guaranteed to be random.
This problem uses bundled tests.
| Special Property | Score | ||
|---|---|---|---|
| None | |||
Translated by ChatGPT 5