Cod sursa(job #2200722)
Utilizator | Data | 2 mai 2018 12:22:03 | |
---|---|---|---|
Problema | Heapuri | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.45 kb |
#include <iostream>
#include <bits/stdc++.h>
#include <fstream>
using namespace std;
ifstream f("heapuri.in");
ofstream g("heapuri.out");
multiset<int> m;
vector<int> v{0};
int main()
{
int op, x;
f>>op;
while(f>>op)if(op==1)
{
f>>x;
m.insert(x);
v.push_back(x);
}
else if(op==2)
{
f>>x;
m.erase(v[x]);
}
else
g<<*m.begin()<<'\n';
return 0;
}