Cod sursa(job #1146564)
| Utilizator | Data | 19 martie 2014 09:09:53 | |
|---|---|---|---|
| Problema | Heapuri | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.44 kb |
#include<fstream>
#include<set>
#include<vector>
#define N 50100
using namespace std;
ifstream f("heapuri.in");
ofstream g("heapuri.out");
using namespace std;
int i,n,tip,x,t,v[N];
set<int> h;
int main ()
{
f>>n;
for(i=1;i<=n;++i)
{
f>>tip;
if(tip==1)
{
f>>x;
h.insert(x);
v[++t]=x;
}
if(tip==2)
{
f>>x;
h.erase(v[x]);
}
if(tip==3)
{
g<<*h.begin()<<"\n";
}
}
return 0;
}
