Pagini recente » Cod sursa (job #1899234) | Cod sursa (job #722859) | Cod sursa (job #883222) | Cod sursa (job #1557965) | Cod sursa (job #2450666)
#include <bits/stdc++.h>
using namespace std;
const int N_MAX = 200005;
int N;
int len;
int Array[N_MAX];
set < int > Set;
int main() {
freopen("heapuri.in", "r", stdin);
freopen("heapuri.out", "w", stdout);
cin >> N;
while (N--) {
int t, x;
cin >> t;
if (t == 1) {
cin >> x;
Set.insert(x);
Array[++len] = x;
} else if (t == 2) {
cin >> x;
Set.erase(Array[x]);
} else {
cout << * Set.begin() << "\n";
}
}
return 0;
}