Cod sursa(job #2975693)
Utilizator | Data | 7 februarie 2023 08:28:58 | |
---|---|---|---|
Problema | Heapuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.53 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("heapuri.in");
ofstream fout("heapuri.out");
multiset<int> h;
int n,tip,x,nr,l[200005];
int main()
{
fin>>n;
while(n--)
{
fin>>tip;
if(tip==1)
{
fin>>x;
h.insert(x);
l[++nr]=x;
}
else if(tip==2)
{
fin>>x;
h.erase(l[x]);
}
else
{
fout<<*h.begin()<<'\n';
}
}
return 0;
}