Pagini recente » Cod sursa (job #3217503) | Diferente pentru problema/smax intre reviziile 8 si 9 | Cod sursa (job #1548179) | Diferente pentru problema/pirati intre reviziile 2 si 1 | Cod sursa (job #3128711)
#include <bits/stdc++.h>
using namespace std;
ifstream in("heapuri.in");
ofstream out("heapuri.out");
int a[200100], n, cnt;
set<int> q;
int main(){
int t, x;
in >> t;
while( t-- ){
cin >> n;
if(n == 3)
out << *(q.begin()) << '\n';
else{
in >> x;
if(n == 1){
a[++cnt]=x;
q.insert(x);
}
else
q.erase(a[x]);
}
}
}