#P5670. 秘籍-反复异或
秘籍-反复异或
Problem Description
Given a sequence of length , support the following operations:
1 l r x: Add to all elements in the interval .2 l r: Query the value of the last binary bits of the XOR sum of all elements in the interval .
Input Format
The first line contains three positive integers , representing the sequence length, the number of bits, and the number of operations.
The second line contains non-negative integers, representing the original sequence .
The next lines each contain several non-negative integers describing an operation.
Output Format
For each operation of type 2, output one line containing a non-negative integer representing the answer.
10 2 10
0 1 0 0 1 0 2 2 0 1
2 3 9
2 1 5
1 9 9 0
1 3 7 2
1 1 6 3
2 1 10
2 6 7
2 3 6
1 3 9 2
1 3 9 3
1
0
3
1
3
Hint
Constraints
This problem has test points.
For test points , .
For test points , .
For test points , let be the test point index, then .
For of the testdata, , , and .
Please pay attention to constant optimization.
Translated by ChatGPT 5