Pagini recente » Cod sursa (job #590512) | Cod sursa (job #2542761) | Cod sursa (job #239709) | Cod sursa (job #401806) | Cod sursa (job #2772295)
#include <iostream>
#include <fstream>
#include<set>
using namespace std;
ifstream f("heapuri.in");
ofstream g("heapuri.out");
set<int>h;
int main()
{
int N,v[200001];
f>>N;
int comanda,x,i,k=1;
for(i=1; i<=N; i++)
{
f>>comanda;
if(comanda==1)
{
f>>x;
h.insert(x);
v[k]=x;
k++;
}
else if(comanda==2)
{
f>>x;
h.erase(v[x]);
}
else
{
g<<*h.begin()<<endl;
}
}
return 0;
}