Cod sursa(job #2896403)
| Utilizator | Data | 29 aprilie 2022 22:43:14 | |
|---|---|---|---|
| Problema | Heapuri | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.51 kb |
#include<set>
#include<fstream>
using namespace std;
ifstream f("heapuri.in");
ofstream g("heapuri.out");
int main()
{
int n,optiune,x,val[200001],j=1;
multiset<int> myset;
f>>n;
for(int i=1;i<=n;i++)
{f>>optiune;
if(optiune==1)
{
f>>x;
myset.insert(x);
val[j]=x;
j++;
}
if(optiune==2)
{
f>>x;
myset.erase(val[x]);
}
if(optiune==3)
{
g<<*myset.begin()<<'\n';
}
}
}
