Cod sursa(job #2302728)
Utilizator | Data | 15 decembrie 2018 08:57:28 | |
---|---|---|---|
Problema | Heapuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.5 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("heapuri.in");
ofstream g("heapuri.out");
set<int>h;
int poz[200001],p,i,m,n,x;
int main()
{
f>>n;
for(i=1;i<=n;i++)
{
f>>p;
if(p==1)
{
f>>x;
h.insert(x);
poz[++m]=x;
}
if(p==2)
{
f>>x;
h.erase(poz[x]);
}
if(p==3)
{
g<<*h.begin()<<'\n';
}
}
return 0;
}