Cod sursa(job #2870969)
| Utilizator | Data | 12 martie 2022 19:04:44 | |
|---|---|---|---|
| Problema | Heapuri | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.56 kb |
#include <fstream>
#include <vector>
#include <set>
using namespace std;
ifstream cin("heapuri.in");
ofstream cout("heapuri.out");
vector<int> poz;
multiset<int> s;
int main()
{
int q,tip,x;
cin>>q;
while(q--)
{
cin>>tip;
if(tip==1)
{
cin>>x;
s.insert(x);
poz.push_back(x);
}
if(tip==2)
{
cin>>x;
s.erase(s.find(poz[x-1]));
}
if(tip==3)
cout<<*s.begin()<<"\n";
}
return 0;
}
