Cod sursa(job #2375378)
Utilizator | Data | 8 martie 2019 08:42:34 | |
---|---|---|---|
Problema | Heapuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.5 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin ("heapuri.in");
ofstream fout ("heapuri.out");
int op, v[200001], x, q;
set <int> Q;
int main()
{
fin >> q;
while(q--)
{
fin >> op;
if (op == 1)
{
fin >> v[++v[0]];
Q.insert(v[v[0]]);
}
else if (op == 2)
{
fin >> x;
Q.erase(v[x]);
}
else fout << *Q.begin() << "\n";
}
return 0;
}