Pagini recente » Monitorul de evaluare | Cod sursa (job #3289995) | Cod sursa (job #2917931) | Profil airineiv | Cod sursa (job #3286106)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("heapuri.in");
ofstream fout("heapuri.out");
int n, tip, x;
vector<int> v;
multiset<int> st;
int main()
{
fin >> n;
for(int i=0; i<n; i++) {
fin >> tip;
if(tip==3) {
fout << *st.begin() << "\n";
} else {
fin >> x;
if(tip==1) {
v.push_back(x);
st.insert(x);
} else {
st.erase(st.find(v[x-1]));
}
}
}
return 0;
}