Pagini recente » Cod sursa (job #2069001) | Cod sursa (job #1356211) | Cod sursa (job #932918) | Cod sursa (job #3196837) | Cod sursa (job #2724269)
#include <fstream>
#include <set>
using namespace std;
#define NMAX 200005
ifstream cin("heapuri.in");
ofstream cout("heapuri.out");
set <int> h;
int a[NMAX],n;
int main()
{
int op, x, m, nr_ord=0;
cin>>m;
for(;m;m--)
{
cin>>op;
if(op==1)
{
cin>>x;
a[++n]=x;
h.insert(x);
}
if(op==2)
{
cin>>x;
h.erase(a[x]);
}
if(op==3)
cout<<*h.begin()<<"\n";
}
return 0;
}