Pagini recente » Cod sursa (job #1522002) | Cod sursa (job #136067) | Cod sursa (job #1595691) | Cod sursa (job #2463882) | 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;
}