#P5312. [Ynoi2011] 竞赛实验班
[Ynoi2011] 竞赛实验班
Description
There is an array of length , indexed starting from . You need to process operations of the following four types:
- Append a number to the end of array .
- Output .
- Change every number in array to . ( denotes the XOR operation.)
- Sort array in non-decreasing order.
Input Format
The first line contains an integer , the initial size of .
The next line contains non-negative integers , representing each element in .
The next line contains an integer , the number of operations.
The next lines each describe one operation:
1 x: the first operation, append to the end.2 l r: the second operation, query . It is guaranteed that , where is the length of the sequence at the time of the operation.3 x: the third operation, XOR every element with .4: the fourth operation, sort array .
Output Format
For each operation of the second type, output the answer.
5
5 2 6 2 0
5
2 1 5
1 2
3 7
2 2 6
4
15
23
Hint
Idea: WJMZBMR, Solution: WJMZBMR, Code: WJMZBMR, Data: WJMZBMR
Translated by ChatGPT 5
京公网安备 11011102002149号