Pagini recente » Cod sursa (job #2681651) | Cod sursa (job #2739851) | Cod sursa (job #611983) | Cod sursa (job #2747184) | Cod sursa (job #2895485)
#include <fstream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
ifstream f("heapuri.in");
ofstream g("heapuri.out");
int N, x, v[200001], index = 0;
short o;
multiset<int> h;
f>>N;
for (int i = 0; i < N; ++i) {
f>>o;
if (o == 1) {
f>>x;
h.insert(x);
++index;
v[index] = x;
} else if (o == 2) {
f>>x;
h.erase(v[x]);
} else {
g<<*h.begin()<<endl;
}
}
return 0;
}