Pagini recente » Cod sursa (job #2089029) | Cod sursa (job #2694030) | Cod sursa (job #3236131) | Cod sursa (job #2616775) | 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;
}