Cod sursa(job #2195781)
| Utilizator | Data | 17 aprilie 2018 13:18:59 | |
|---|---|---|---|
| Problema | Heapuri | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.42 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream in("heapuri.in");
ofstream out("heapuri.out");
int n, st[200100], vf, cod, x;
multiset <int> h;
int main(){
in >> n;
while(n--){
in >> cod;
if(cod == 1){
in >> x;
h.insert(x);
st[++vf] = x;
continue;
}
if(cod == 2){
in >> x;
h.erase(h.find(st[x]));
continue;
}
out << *h.begin() << '\n';
}
return 0;
}
