Pagini recente » Cod sursa (job #1151073) | Cod sursa (job #2547517) | Cod sursa (job #65074) | Cod sursa (job #251777) | Cod sursa (job #2895446)
#include <iostream>
#include <fstream>
#include<bits/stdc++.h>
using namespace std;
int N, o, x, v[200002], index, i;
multiset<int> h;
int main()
{
ifstream f("heapuri.in");
ofstream g("heapuri.out");
index = 0;
f>>N;
for (i = 0; i < N; ++i) {
f>>o;
if (o == 1) {
f>>x;
h.insert(x);
v[++index] = x;
} else if (o == 3) {
g<<*h.begin()<<endl;
} else {
f>>x;
h.erase(v[x]);
}
}
return 0;
}