Cod sursa(job #485474)
Utilizator | Data | 18 septembrie 2010 15:14:37 | |
---|---|---|---|
Problema | Heapuri | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.34 kb |
#include<set>
#include<fstream>
using namespace std;
int n,k,x,y;
int l[201000];
set<int> V;
int main()
{ifstream q("heapuri.in");
ofstream w("heapuri.out");
q>>n;
for(int i=1;i<=n;++i)
{q>>x;
if(x==1)
{q>>y;
l[++k]=y;
V.insert(y);}
if(x==2)
{q>>y;
V.erase(l[y]);}
if(x==3)
w<<*V.begin()<<"\n";}}