#P4146. 序列终结者
序列终结者
Description
Given a sequence of length , each element is an integer (trivial). You need to support the following three operations:
- Add to every number in the interval .
- Reverse the interval , for example,
1 2 3 4becomes4 3 2 1. - Query the maximum value in the interval .
Initially, all elements are .
Input Format
The first line contains two integers . is the number of operations.
The next lines each contain up to four integers, in order: . indicates the operation type. If it is not the st operation, then only two numbers follow .
Output Format
For each operation of type , output the correct answer.
4 4
1 1 3 2
1 2 4 -1
2 1 3
3 2 4
2
Hint
,,。
Translated by ChatGPT 5
京公网安备 11011102002149号