Pagini recente » Cod sursa (job #2196194) | Cod sursa (job #2548942) | Cod sursa (job #2092377) | Cod sursa (job #3146602) | Cod sursa (job #2195781)
#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;
}