Point Assign, Range Max
Support U i v (assign ai = v) and Q l r (print the maximum of al..r).
Input: the first line has N and Q; the second line has the array; each of the next Q lines is an operation.
Output: one line per query.
Constraints:
- 1 ≤ N, Q ≤ 105
- |values| ≤ 106
Sample Tests
Input 1
5 3 1 5 2 4 3 Q 1 5 U 2 0 Q 1 3
Output 1
5 2
Input 2
1 1 7 Q 1 1
Output 2
7
Discussion (opens after you solve — no spoilers before)
No comments yet.