Cod sursa(job #2302727)
Utilizator | Data | 15 decembrie 2018 08:54:55 | |
---|---|---|---|
Problema | Heapuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.47 kb |
#include <fstream>
#include <set>
using namespace std;
ifstream f("heapuri.in");
ofstream g("heapuri.out");
set<int>h;
int n,i,a[200005],x,c,k;
int main()
{
f>>n;
for(i=1;i<=n;i++)
{
f>>c;
if(c==1)
{
f>>x;
h.insert(x);
a[++k]=x;
}
else if(c==2)
{
f>>x;
h.erase(a[x]);
}
else g<<*h.begin()<<'\n';
}
return 0;
}