Submit solution
Points:
15
Time limit:
1.0s
Java
2.0s
Python
4.0s
Memory limit:
1G
Author:
Problem type
Levve loves segment trees, so he has given you the following task:
You are given an array of
C x v
: Change the element's value at index to .S l r
: Output the sum of all elements between indices and , inclusive.M l r
: Output the maximum of all elements between indices and , inclusive.
Levve doesn't like cheesing, so you will not be given S
or M
query, and
Similarly:
Constraints
Input Specification
The first line contains two space-separated integers,
The following
Output Specification
For each S
or M
query, output its result on a new line.
Sample Input
Copy
10 5
C 2 1
C 7 3
S 1 5
C 2 9
M 2 8
Sample Input (Unencrypted)
Copy
10 5
C 2 1
C 7 3
S 1 5
C 3 8
M 3 9
Sample Output
Copy
1
8
Comments
Since the original data were weak, an additional test case was added, and all submissions were rejudged.