#P5693. EI 的第六分块
EI 的第六分块
Description
Given an integer sequence , support two operations:
1 l r xmeans adding to every number in the interval .2 l rmeans querying the maximum subarray sum of the interval (it may be empty).
Input Format
The first line contains two positive integers , representing the length of the sequence and the number of operations. The next line contains integers, representing the initial sequence . Then there are lines, each containing several integers, representing one operation.
Output Format
For each operation of type 2, output one line with one integer 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
Hint
Constraints
For of the testdata, .
For of the testdata, .
For of the testdata, , , .
Idea: nzhtl1477. Solution: EntropyIncreaser. Code: EntropyIncreaser. Data: NaCly_Fish.
Please pay attention to constant-factor optimization.
Translated by ChatGPT 5
京公网安备 11011102002149号