#P1253. 扶苏的问题
扶苏的问题
Description
Given a sequence of length , support the following three operations:
- Given a range , set every number in the range to .
- Given a range , add to every number in the range.
- Given a range , query the maximum value in the range.
Input Format
The first line contains two integers, the length of the sequence and the number of operations .
The second line contains integers, where the -th integer is the -th number in the sequence.
Then follow lines, each representing an operation. Each line starts with an integer indicating the type of operation.
- If , then there are three integers , meaning set every number in the range to .
- If , then there are three integers , meaning add to every number in the range .
- If , then there are two integers , meaning query the maximum value in the range .
Output Format
For each operation with , output one line with a single integer representing the answer.
6 6
1 1 4 5 1 4
1 1 2 6
2 3 4 2
3 1 4
3 2 3
1 1 6 -1
3 1 6
7
6
-1
4 4
10 4 -3 -7
1 1 3 0
2 3 4 -4
1 2 4 -9
3 1 4
0
Hint
Constraints
- For of the testdata, .
- For of the testdata, .
- For of the testdata, .
- For of the testdata, .
- For of the testdata, .
- For of the testdata, , , , .
Please note the impact of large input on program efficiency.
Translated by ChatGPT 5
京公网安备 11011102002149号