Pagini recente » Cod sursa (job #151579) | Cod sursa (job #1732036) | Cod sursa (job #169250) | Cod sursa (job #1666808) | Cod sursa (job #552280)
Cod sursa(job #552280)
var i,j,n,c,x,nr,min:longint;
f1,f2:text;
a:array[1..200000]of longint;
m:array[1..200000]of boolean;
begin
assign(f1,'heapuri.in');
reset(f1);
assign(f2,'heapuri.out');
rewrite(f2);
readln(f1,n);
nr:=0;
for i:=1 to n do
begin
read(f1,c);
if c=1 then
begin
inc(nr);
m[nr]:=true;
readln(f1,a[nr]);
end else
if c=2 then
begin
readln(f1,x);
a[x]:=0;
m[x]:=false;
end else
if c=3 then
begin
min:=1000000000;
for j:=1 to nr do
if m[j] then if a[j]<min then min:=a[j];
writeln(f2,min);
end;
end;
close(f1);
close(f2);
end.