Pagini recente » Cod sursa (job #115471) | Rating Dobrin Cotea Antonio (Dobrin_Antonio) | Cod sursa (job #2323225) | Cod sursa (job #1489824) | Cod sursa (job #2337801)
#include <iostream>
#include <set>
#include <fstream>
using namespace std;
ifstream f("heapuri.in");
ofstream g("heapuri.out");
set <int> h;
int n,x,e,v[100000000],k,i;
int main()
{
f>>n;
k=1;
for(i=1;i<=n;i++)
{
f>>x;
if(x==1)
{
f>>e;
v[k++]=e;
h.insert(e);
}
if(x==2)
{
f>>e;
h.erase(v[e]);
}
if(x==3)
{
int el;
el= *h.begin();
g<<el<<"\n";
}
}
return 0;
}