Pagini recente » Cod sursa (job #1288090) | Cod sursa (job #1160664) | Cod sursa (job #1023968) | Cod sursa (job #245583) | Cod sursa (job #2906475)
#include <bits/stdc++.h>
#include <set>
using namespace std;
ifstream fin ("heapuri.out");
ofstream fout("heapuri.out");
set<int> h;
int n,x,v[200001],poz=1,y;
int main()
{
fin>>n;
for(int i=0;i<n;i++)
{
fin>>x;
if(x==1)
{
fin>>y;
h.insert(y);
v[poz]=y;
poz++;
}
else
if(x==2)
{
fin>>y;
h.erase(v[y]);
}
else
if(x==3)
{
fout<<*h.begin()<<"\n";
}
}
return 0;
}