#C. 考验(2)

    Type: Default 1000ms 256MiB

考验(2)

No testdata at current.

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Description

给你一个长度为n的数组a,有m次操作,每次给你一个数字op,

  • 若op=1,则再输入两个数l,r,请求出a数组区间(l,r)里的最大值。
  • 若op=2,则再输入两个数x,k,表示将数组a的第x项修改为k。

Format

Input

第一行两个正整数,n,m。第二行n个整数,表示数组a。后面m行,每行3个正整数。

Output

对于每一次op=1的操作,输出结果。

Samples

5 6
2 4 3 1 5
1 1 5
1 2 4
1 4 4
1 1 2
2 5 0
1 1 5
5
4
1
4
4

Limitation

对于40%的数据,1n,m1031≤n,m≤10^3 对于100%的数据,1lrn51051m21051≤l≤r≤n≤5*10^5,1≤m≤2*10^5

考验

Not Attended
Status
Done
Rule
ACM/ICPC
Problem
4
Start at
2022-11-12 10:45
End at
2022-12-19 22:45
Duration
900 hour(s)
Host
Partic.
6