Pagini recente » Cod sursa (job #2467546) | Cod sursa (job #2250322) | Cod sursa (job #78071) | Cod sursa (job #1153231) | Cod sursa (job #152769)
Cod sursa(job #152769)
var f,g:text;
n,a,b,c,i:longint;
h:array[1..100000]of integer;
begin
assign(f,'arbint.in');reset(f);
assign(g,'arbint.out');rewrite(g);
readln(f,n);
for i:=1 to n do read(f,h[i]);
for i:=1 to n 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.