Cod sursa(job #2619552)
Utilizator | Data | 27 mai 2020 22:24:01 | |
---|---|---|---|
Problema | Heapuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.55 kb |
#include<iostream>
#include <fstream>
#include<set>
std::ifstream f("heapuri.in");
std::ofstream g("heapuri.out");
std::set<int>h;
int poz[200002];
int main()
{
int n,i,c,x;
f>>n;
int k=0;
for(i=0;i<n;i++)
{
f>>c;
if(c==1)
{
f>>x;
h.insert(x);
k++;
poz[k]=x;
}
if(c==2)
{
f>>x;
h.erase(poz[x]);
}
if(c==3)
g<<*h.begin()<<'\n';
}
return 0;
}