Pagini recente » Borderou de evaluare (job #3007126) | Cod sursa (job #3266007) | Statistici Serban Eniko (eniserbana) | Cod sursa (job #3264732) | Cod sursa (job #3289441)
#include <bits/stdc++.h>
using namespace std;
ifstream f("heapuri.in");
ofstream g("heapuri.out");
int n,op,x,k,v[200200];
multiset <int> st;
int main()
{
f>>n;
for(int i=1; i<=n; i++)
{
f>>op;
if(op==1)
f>>x, st.insert(x), v[++k]=x;
if(op==2)
f>>x, st.erase(st.lower_bound(v[x]));
if(op==3)
g<<(*st.begin())<<'\n';
}
return 0;
}