#P7447. [Ynoi2007] rgxsxrs
[Ynoi2007] rgxsxrs
Background
The input size of this problem is about 15 MB, and the output size is about 13 MB. Please choose an appropriate input/output method.
Problem Description
Given a sequence of length , you need to perform operations:
1 l r x: Decrease by all elements in the interval that are .
2 l r: Query the sum, minimum value, and maximum value of the interval .
Input Format
The first line contains two positive integers .
The second line contains positive integers representing the sequence .
Then follow lines, each containing or positive integers, representing one operation.
This problem is forced online: all input must be XORed with , where is defined as the value of (the interval sum obtained from the previous query operation) modulo . If there has been no query operation before, then it is .
Output Format
For each operation of type , output one line with three numbers separated by spaces, representing the answer.
5 5
2 4 5 1 3
1 2 4 3
2 1 5
2 10 12
1 7 3 7
2 5 3
9 1 3
6 1 3
4 1 2
Hint
Idea: wangziji & 花花 (Huahua), Solution: wangziji & 花花 (Huahua), Code: ccz181078, Data: wangziji & 花花 (Huahua) & ccz181078.
Note: This problem uses bundled testing. Only after you pass all test points in a subtask can you get the score for that subtask.
For of the testdata, , and the time limit is 3 s.
For another of the testdata, , , and the time limit is 3 s.
For another of the testdata, , , and the time limit is 3 s.
For another of the testdata, , , and the time limit is 3 s.
For of the testdata, , .
Translated by ChatGPT 5