Cod sursa(job #1719820)
Utilizator | Data | 20 iunie 2016 14:08:30 | |
---|---|---|---|
Problema | Heapuri | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.54 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("heapuri.in");
ofstream fout("heapuri.out");
set <int> s;
int n,x,y,chrno[10000001],k;
int main()
{
fin>>n;
for(int i=1; i<=n; ++i)
{
fin>>x;
if(x==3) fout<<*s.begin()<<"\n";
else
{
fin>>y;
if(x==1)
{
s.insert(y);
chrno[++k]=y;
}
if(x==2)
{
s.erase(chrno[y]);
}
}
}
return 0;
}