Pagini recente » Cod sursa (job #2559675) | Cod sursa (job #2699400) | Cod sursa (job #1429700) | Cod sursa (job #2069901) | Cod sursa (job #2418399)
#include <bits/stdc++.h>
#define Dim 200008
using namespace std;
ifstream f("heapuri.in");
ofstream g("heapuri.out");
int N,op,x,cnt;
int How[Dim];
set < int > S;
set < int > ::iterator it;
int main()
{
f>>N;
for(int i=1;i<=N;i++)
{
f>>op;
if(op==1)
{
cnt++;
f>>x;
How[cnt]=x;
S.insert(x);
}
else
if(op==2)
{
f>>x;
S.erase(How[x]);
}
else
{
it=S.begin();
g<<*it<<'\n';
}
}
return 0;
}