Pagini recente » Cod sursa (job #1493777) | Cod sursa (job #656234) | Cod sursa (job #481965) | Cod sursa (job #1624608) | Cod sursa (job #3189613)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("heapuri.in");
ofstream fout("heapuri.out");
int t, op, x, ord[200002], k;
multiset<int> h;
int main() {
fin >> t;
while(t--) {
fin >> op;
if(op == 1) {
fin >> x;
ord[++k] = x;
h.insert(x);
}
else if(op == 2) {
fin >> x;
h.erase(h.find(ord[x]));
}
else fout << *h.begin() << "\n";
}
return 0;
}