#P5073. [Ynoi Easy Round 2015] 世上最幸福的女孩
[Ynoi Easy Round 2015] 世上最幸福的女孩
Description
At the very end, Ctholly gives you a sequence of length , with operations:
- Global add (i.e., add to all numbers in the sequence).
- Query the maximum subarray sum in an interval.
Input Format
The first line contains two integers .
The second line contains numbers representing the sequence.
Then follow lines, each describing one operation.
- : Add to all numbers.
- : Query the maximum subarray sum in the interval (you may choose no elements; in this case the maximum subarray sum is ).
Output Format
For each query, output one number as the answer.
5 7
-10 -3 -2 -4 -5
2 2 4
1 5
2 2 4
1 3
2 1 5
1 2
2 3 5
0
6
18
19
Hint
Idea: nzhtl1477, Solution: ccz181078, Code: nzhtl1477&w33z8kqrqk8zzzx33, Data: nzhtl1477.
Constraints: , , the absolute value of numbers in the sequence , and the absolute value of in operation is .
Translated by ChatGPT 5
京公网安备 11011102002149号