Cod sursa(job #2650916)
Utilizator | Data | 20 septembrie 2020 20:21:28 | |
---|---|---|---|
Problema | Heapuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.49 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream in("heapuri.in");
ofstream out("heapuri.out");
vector<int> v;
multiset<int> s;
int main()
{
int n,t,x;
in>>n;
while(n--)
{
in>>t;
if(t==1)
{
in>>x;
v.push_back(x);
s.insert(x);
}
else if(t==2)
{
in>>x;
s.erase(s.find(v[x-1]));
}
else out<<(*s.begin())<<'\n';
}
return 0;
}