#P4117. [Ynoi2018] 五彩斑斓的世界
[Ynoi2018] 五彩斑斓的世界
Description
Erjiedang Zhenhong gives you a sequence of length , with operations.
- For every number greater than in the interval , subtract from it.
- Query the number of occurrences of in the interval .
Input Format
The first line contains two integers and .
The second line contains integers representing the sequence .
Then follow lines, each containing four integers:
1 l r x: For all numbers greater than in , subtract .2 l r x: Query the number of occurrences of in $[l,r]`.
Output Format
For each type-2 query, output one integer representing the answer.
5 6
1 5 5 5 8
2 2 5 5
1 2 4 3
2 2 5 2
2 2 5 5
1 3 5 1
2 1 5 1
3
3
0
3
Hint
Idea: nzhtl1477, Solution: nzhtl1477, Code: nzhtl1477, Data: nzhtl1477.
For of the testdata, , , , .
By nzhtl1477.
Translated by ChatGPT 5
京公网安备 11011102002149号