#P3863. 序列
序列
Description
Given a sequence of length , there are operations of the following forms.
means adding to each element with index in (note that may be negative).
means querying for how many seconds in the past has been at least (excluding the current second; see the sample for details).
Time starts at second , and the -th operation occurs at second .
Input Format
The first line contains two integers , as described.
The second line contains integers , the initial values of the sequence.
Each of the next lines starts with , indicating the type of this operation. If , it is followed by three integers , as described. If , it is followed by two integers , as described.
Output Format
For each operation of type , output one integer on a single line indicating the answer.
3 3
1 3 5
2 1 2
1 1 2 -3
2 1 1
0
2
Hint
Explanation for Sample 1: at position , the values from second to second are . For the first query, during seconds to , the value is not less than . For the second query, during seconds to , the value is not less than , namely at second and second .
For of the testdata, .
For of the testdata, .
For of the testdata, , , , .
Translated by ChatGPT 5
京公网安备 11011102002149号