Pagini recente » Cod sursa (job #1080506) | Cod sursa (job #614973) | Cod sursa (job #2349754) | Cod sursa (job #3227307) | Cod sursa (job #1343116)
var n,m,a,b,c,i,j,max:longint;
v:array[1..100001] of longint;
begin
assign(input,'arbint.in');
assign(output,'arbint.out');
reset(input);
rewrite(output);
read(n,m);
for i:=1 to n do
read(v[i]);
for i:=1 to m do begin
max:=0;
read(c,a,b);
if c=1 then
v[a]:=b;
if c=0 then begin
for j:=a to b do begin
if v[j]>max then max:=v[j];
end;
writeln(max);
end;
end;
end.