#P10587. 「ALFR Round 2」C 小 Y 的数
「ALFR Round 2」C 小 Y 的数
Problem Description
Xiao Y likes the number very much, so he also likes numbers that start with and then keep appending alternately, such as . Xiao Y gives you an integer sequence of length . There are operations, and there are four types of operations:
-
1 l r xAdd to the numbers in positions . -
2 l r xMultiply the numbers in positions by . -
3 l r xSet the numbers in positions to . -
4 l rQuery how many numbers in positions are liked by Xiao Y.
Input Format
The first line contains two integers .
The second line contains integers .
The next lines each contain or integers describing one operation.
Output Format
Output one line for each operation of type , containing its answer.
8 8
41 42 43 44 45 46 47 47
4 1 8
1 1 8 377
4 1 8
2 1 1 100
1 1 8 624
4 1 7
3 1 8 424242
4 1 5
1
2
1
5
Hint
Sample Explanation
In the st operation, query how many numbers in the interval are liked by Xiao Y. There is such number, which is .
In the nd operation, add to the numbers in the interval , and the sequence becomes .
In the rd operation, query how many numbers in the interval are liked by Xiao Y. There are such numbers, which are .
In the th operation, multiply the numbers in the interval by , and the sequence becomes .
In the th operation, add to the numbers in the interval , and the sequence becomes .
In the th operation, query how many numbers in the interval are liked by Xiao Y. There is such number, which is .
In the th operation, set the numbers in the interval to , and the sequence becomes $424242,424242,424242,424242,424242,424242,424242,424242$.
In the th operation, query how many numbers in the interval are liked by Xiao Y. There are such numbers, which are .
Constraints
| Subtask | Points | Constraints |
|---|---|---|
| - |
For of the testdata, , .
It is guaranteed that after each operation, .
Translated by ChatGPT 5