Pagini recente » Cod sursa (job #3363482) | Cod sursa (job #3362364) | Cod sursa (job #3362234) | Cod sursa (job #3363486) | Cod sursa (job #3363487)
#include <bits/stdc++.h>
using namespace std;
ifstream fin("heapuri.in");
ofstream fout("heapuri.out");
int curent = 0, v[200003];
set<int> st;
int main()
{
int tt; fin >> tt;
while(tt--) {
int tip; fin >> tip;
if(tip == 1) {
fin >> v[++curent];
st.insert(v[curent]);
}
else if(tip == 2) {
int x; fin >> x;
st.erase(v[x]);
}
else fout << *st.begin() << '\n';
}
return 0;
}