#P5586. [P5350] 序列 (加强版)
[P5350] 序列 (加强版)
Description
There is a sequence and operations.
1 l rQuery the sum of the interval .2 l r kAssign all values in the interval to .3 l r kAdd to all values in the interval .4 l1 r1 l2 r2Copy the interval to .5 l1 r1 l2 r2Swap the intervals and .6 l rReverse the interval .
In the end, you also need to output the entire sequence. All outputs should be taken modulo .
To block some brute-force or hacky solutions, this problem is strictly online.
In each operation, except for the first number, all other numbers must be XORed with to obtain the actual operation.
is the answer of the previous type operation , and initially .
Input Format
The first line contains two positive integers , representing the sequence length and the number of operations.
The second line contains positive integers, representing the sequence .
The next lines each describe one operation.
Output Format
For each type operation, output one integer per line as the answer.
In the last line, output integers, representing the final sequence .
10 10
7 1 3 2 2 4 0 1 2 2
4 10 10 3 3
3 4 10 5
6 6 7
6 9 10
1 10 10
5 14 13 1 0
2 15 13 7
5 3 3 2 2
5 5 3 15 13
3 4 14 7
7
7 0 0 0 7 7 7 1 2 7
Hint
Constraints
For operations and , it is guaranteed that and .
The testdata is not guaranteed to be random, and there is no grading by subtasks.
If you want to submit ODT, just forget it.
Translated by ChatGPT 5
京公网安备 11011102002149号