#P4118. [Ynoi2018] 末日时在做什么?有没有空?可以来拯救吗?
[Ynoi2018] 末日时在做什么?有没有空?可以来拯救吗?
Description
Chtholly gives you a sequence of length , and there are operations.
- Add to all numbers in the interval .
- Query the maximum subarray sum in the interval , where choosing no elements is allowed.
Input Format
The first line contains two integers . The second line contains integers representing the sequence . The following lines:
1 l r x: add to all numbers in the interval .2 l r: query the maximum subarray sum in the interval , with the empty subarray allowed.
Output Format
For each query, output one number representing the answer.
5 5
-2 -3 -3 -3 -3
2 1 5
1 2 4 4
2 1 5
1 2 3 1
2 3 3
0
3
2
5 5
-2 3 3 -3 3
2 1 5
1 2 4 -4
2 1 5
1 2 3 1
2 3 3
6
3
0
Hint
Idea: nzhtl1477, Solution: ccz181078, Code: nzhtl1477 & ccz181078 & mrsrz, Data: nzhtl1477 & mrsrz & w33z8kqrqk8zzzx33.
, , .
It is guaranteed that at any time .
By nzhtl1477 & ccz181078.
Translated by ChatGPT 5
京公网安备 11011102002149号