#P8937. [JRKSJ R7] 五彩斑斓的曙光
[JRKSJ R7] 五彩斑斓的曙光
Background
The problem name was provided by fjy666, background TBD.
Problem Description
You are given a sequence of length . Please support operations:
- Subtract from the numbers in the interval .
- Query the count of numbers in the interval .
Input Format
This problem is strictly online.
The first line contains two integers .
The second line contains integers representing .
The next lines each contain four integers , where is the operation type. The real is obtained by taking XOR the answer of the most recent operation . If there has been no operation before, then no XOR is needed, and the real is simply .
Output Format
For every operation , output one integer per line as the answer.
10 10
20 10 20 14 4 15 11 20 2 13
2 5 9 1
1 7 8 2
1 2 3 8
1 4 6 12
2 1 7 9
2 2 7 20
2 3 9 4
2 8 9 7
1 3 10 0
2 8 9 7
0
5
6
2
1
1
5 5
6 10 3 4 7
1 1 3 3
1 3 4 3
2 3 5 3
1 1 3 11
2 2 3 5
2
2
Hint
Idea: Ntokisq&nzhtl1477, Solution: Ntokisq, Code: Ntokisq, Data: Ntokisq.
Sample Explanation
Sample before encryption:
10 10
20 10 20 14 4 15 11 20 2 13
2 5 9 1
1 7 8 2
1 2 3 8
1 4 6 12
2 1 7 9
2 2 7 17
2 3 9 2
2 8 9 5
1 3 10 1
2 8 9 6
Sample before encryption:
5 5
6 10 3 4 7
1 1 3 3
1 3 4 3
2 3 5 3
1 1 3 9
2 2 3 7
Constraints
This problem uses bundled testdata.
| Time Limit | ||||
|---|---|---|---|---|
For of the testdata, , , , and .
Hint
If you believe your algorithm has the correct time complexity but the constant factor is too large, you may use an algorithm with the same idea, slightly worse time complexity, but a smaller constant factor.
Translated by ChatGPT 5