Pagini recente » Cod sursa (job #743832) | Cod sursa (job #1096816) | Cod sursa (job #2977037) | Cod sursa (job #2877464) | Cod sursa (job #2746336)
#include <bits/stdc++.h>
using namespace std;
ifstream f("heapuri.in");
ofstream g("heapuri.out");
long N,cod,x,p,ord[1000000];
set<long> h;
int main()
{
f>>N;
for(int i=1; i<=N; i++)
{
f>>cod;
if(cod!=3)
f>>x;
switch(cod)
{
case 1:
{
h.insert(x);
ord[++p]=x;
}
break;
case 2:
h.erase(ord[x]);
break;
case 3:
{g<<*h.begin();
g<<'\n';}
break;
}
}
return 0;
}