Pagini recente » Cod sursa (job #2241628) | Cod sursa (job #168863) | Cod sursa (job #1794071) | Cod sursa (job #555845) | Cod sursa (job #2600179)
#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define ft first
#define sc second
#define ll long long
ifstream fin("heapuri.in"); ofstream fout("heapuri.out");
int n, e[200010];
multiset<int> heap;
int main(){
fin>>n;
int j=1;
for(int i=1; i<=n ; i++){
int x, o;
fin>>o;
if(o==1){
fin>>x;
heap.insert(x);
e[j]=x;
j++;
}
if(o==2){
fin>>x;
heap.erase(heap.find(e[x]) );
}
if(o==3){
fout<<*(heap.begin())<<"\n";
}
}
return 0;
}