Pagini recente » Cod sursa (job #3288059) | Cod sursa (job #183470) | Cod sursa (job #2707984) | Cod sursa (job #2120353) | Cod sursa (job #152777)
Cod sursa(job #152777)
var f,g:text;
n,a,b,c,i,m:longint;
h:array[1..100000]of integer;
begin
assign(f,'arbint.in');reset(f);
assign(g,'arbint.out');rewrite(g);
readln(f,n,m);
for i:=1 to n do read(f,h[i]);
for i:=1 to m do
begin
read(f,c,a,b);
if c=0 then begin
if h[a]>=h[b] then writeln(g,h[a])
else writeln(g,h[b]);
end
else h[a]:=b;
end;
close(f);
close(g);
end.