Pagini recente » Cod sursa (job #3124344) | Cod sursa (job #738737) | Cod sursa (job #2023916) | Cod sursa (job #2107743) | Cod sursa (job #2859196)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("heapuri.in");
ofstream fout("heapuri.out");
multiset<int> h;
int v[200002], n, c, x, m;
int main() {
fin >> n;
for(int i = 1; i <= n; i++) {
fin >> c;
if(c == 1) {
fin >> x;
v[++m] = x;
h.insert(x);
} else if(c == 2) {
fin >> x;
h.erase(v[x]);
} else if(c == 3) {
fout << (*h.begin()) << "\n";
}
}
return 0;
}