Pagini recente » Cod sursa (job #1922053) | Cod sursa (job #2002218) | Cod sursa (job #1852849) | Cod sursa (job #1698302) | Cod sursa (job #552284)
Cod sursa(job #552284)
var i,j,n,m,c,max,a,b:longint;
f1,f2:text;
v:array[1..200000]of longint;
begin
assign(f1,'arbint.in');
reset(f1);
assign(f2,'arbint.out');
rewrite(f2);
readln(f1,n,n);
for i:=1 to n do
read(f1,v[i]);
for i:=1 to m do
begin
read(f1,c,a,b);
if c=0 then
begin
max:=v[a];
for j:=a+1 to b do
if v[j]>max then max:=v[j];
writeln(f2,max);
end else
if c=1 then
v[a]:=b;
end;
close(f1);
close(f2);
end.