Cod sursa(job #2681356)
Utilizator | Data | 5 decembrie 2020 12:00:32 | |
---|---|---|---|
Problema | Heapuri | Scor | 40 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.53 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("heapuri.in");
ofstream g("heapuri.out");
set <int> h;
int n,i,t,x,pos[200002],nr;
int main()
{
f>>n;
for(i=1;i<=n;i++)
{
f>>t;
if(t==3)
{
g<<*h.begin()<<endl;
}
else
{
f>>x;
if(t==2)
h.erase(pos[x]);
else
{
h.insert(x);
pos[++nr]=x;
}
}
}
return 0;
}