Cod sursa(job #2907074)
Utilizator | Data | 28 mai 2022 17:32:05 | |
---|---|---|---|
Problema | Heapuri | Scor | 40 |
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 main(){
int N, cv, x, i, poz=1, v[200001];
f>>N;
for(i=0; i<N; i++){
f>>cv;
if(cv==1){
f>>x;
h.insert(x);
v[poz]=x;
poz++;
}
if(cv==2){
f>>x;
h.erase(v[x]);
}
if(cv==3)
g<<*h.begin()<<'\n';
}
return 0;
}