Pagini recente » Cod sursa (job #375619) | Cod sursa (job #863651) | Cod sursa (job #843225) | Cod sursa (job #413521) | Cod sursa (job #2895445)
#include <iostream>
#include <fstream>
#include<bits/stdc++.h>
using namespace std;
int N, o, x, v[200002], index = 0, i;
multiset<int> h;
int main()
{
ifstream f("heapuri.in");
ofstream g("heapuri.out");
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;
}