Pagini recente » Cod sursa (job #2756263) | Cod sursa (job #214792) | Cod sursa (job #3250808) | Cod sursa (job #637387) | Cod sursa (job #1360250)
#include <iostream>
#include <fstream>
#include <set>
using namespace std;
ifstream f("heapuri.in");
ofstream g("heapuri.out");
multiset <int> heap;
int n,op;
int poz[200009];
int nr;
int main()
{
f>>n;
int x;
for(n;n>0;n--){
f>>op;
if(op==1){
f>>x;
poz[++nr]=x;
heap.insert(x);
}
else if(op==2){
f>>x;
heap.erase(heap.find(poz[x]));
}
else g<<*heap.begin()<<endl;
}
return 0;
}