#P5612. [Ynoi2013] Ynoi
[Ynoi2013] Ynoi
Problem Description
Maintain a sequence consisting of non-negative integers, and support three operations:
- Given an interval , apply XOR with to every number in this interval.
- Given an interval , sort the numbers in this interval in non-decreasing order.
- Given an interval , compute the XOR sum of the numbers in this interval.
Input Format
The first line contains two integers .
The second line contains integers , representing the original sequence.
The next lines describe the operations. Each line contains three integers (), or four integers (), representing the corresponding operation.
Output Format
For each operation , output one line with the corresponding answer.
5 3
1 4 2 8 3
2 1 3
1 2 4 5
3 1 2
6
Hint
Idea: ccz181078, Solution: ccz181078, Code: ccz181078&nzhtl1477, Data: ccz181078.
Sample Explanation
The original sequence is .
Sort the interval , getting .
Apply bitwise XOR with to the interval : , , , getting .
Query the XOR sum of the interval : , .
Constraints
, 。
Translated by ChatGPT 5