Cod sursa(job #2450666)
| Utilizator | Data | 24 august 2019 02:01:13 | |
|---|---|---|---|
| Problema | Heapuri | Scor | 40 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.59 kb |
#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;
}
