#P6780. [Ynoi2009] pmrllcsrms
[Ynoi2009] pmrllcsrms
Problem Description
You are given an integer sequence of length , and a constant .
There are operations:
1 x y: Modify the value at position to .
2 l r: Query $\max\left(\max_{l \leq l' \leq r' \leq r\atop r'-l'+1\leq c} ~~ \left(\sum_{i=l'} ^{r'} a_i\right), 0\right)$ within the interval .
Input Format
The first line contains three positive integers , representing the length of the sequence, the number of operations, and the given constant.
The next line contains integers , representing the sequence .
Then follow lines, each containing three numbers describing one operation, with the meaning as stated above.
Output Format
For each query, output one line with one number representing the answer.
5 10 2
0 -5 -3 8 -3
1 5 -1
1 2 3
1 5 -6
1 2 9
2 5 5
2 3 3
1 1 -3
2 4 4
1 1 4
1 3 3
0
0
8
Hint
Idea: chenkuowen&nzhtl1477, Solution: ccz181078, Code: ccz181078, Data: ccz181078.
For of the testdata, , , , , .
Translated by ChatGPT 5