Pagini recente » Cod sursa (job #3223750) | Rating Vlad Teodorescu (vladvlad00) | Rating Apostol Mihnea Petru (PetruApostol) | Monitorul de evaluare | Cod sursa (job #3286663)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("heapuri.in");
ofstream fout("heapuri.out");
vector<int>v;
multiset<int>s;
int main()
{
int q;
fin >> q;
for(; q>0; q--)
{
int op, x;
fin >> op;
if(op<3)
fin >> x;
if(op==1)
{
v.push_back(x);
s.insert(x);
}
else if(op==2)
{
s.erase(s.find(v[x-1]));
}
else
{
auto t=s.begin();
fout << *t << "\n";
}
}
return 0;
}