Pagini recente » Cod sursa (job #1436081) | Cod sursa (job #1222676) | Cod sursa (job #856403) | Cod sursa (job #1146613) | Cod sursa (job #3033300)
#include <bits/stdc++.h>
using ll=long long;
#define S second
#define F first
#define endl '\n'
#define spid ios_base::sync_with_stdio(false);cin.tie(NULL);
const int mod=1e9+7;
const double pi=3.14159265359;
const int maxn=200001;
using namespace std;
int n,ord[maxn];
multiset<int> A;
int main(){
ifstream cin("heapuri.in");
ofstream cout("heapuri.out");
cin>>n;
int ins=1;
for(int i=1;i<=n;i++){
int c;
cin>>c;
if(c==1){
cin>>ord[ins];
A.insert(ord[ins]);
ins++;
}
else if(c==2){
int x;
cin>>x;
A.erase(ord[x]);
}
else cout<<*A.begin()<<endl;
}
}