Cod sursa(job #1605613)
Utilizator | Data | 19 februarie 2016 11:42:25 | |
---|---|---|---|
Problema | Heapuri | Scor | 20 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.49 kb |
#include <iostream>
#include <fstream>
#include <set>
using namespace std;
ifstream fin("heapuri.in");
ofstream fout("heapuri.out");
int n,x,vec[200001],t;
int main()
{
fin>>n;
set <int> my_set;
for(int i=0;i<n;i++)
{
fin>>x;
if(x==1)
fin>>x,my_set.insert(x),vec[t++]=x;
if(x==2)
fin>>x,my_set.erase(vec[x-1]);
if(x==3)
{
fout<<*my_set.begin()<<endl;
}
}
return 0;
}