Cod sursa(job #3124151)
| Utilizator | Data | 27 aprilie 2023 01:29:46 | |
|---|---|---|---|
| Problema | Heapuri | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.62 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("heapuri.in");
ofstream g("heapuri.out");
int main() {
int n, pos = 1;
set<int> st;
int vec[100001];
f >> n;
while(n--){
int q, x;
f >> q;
switch(q){
case 1:
f >> x;
st.insert(x);
vec[pos++] = x;
break;
case 2:
f >> x;
st.erase(vec[x]);
break;
case 3:
g << *st.begin() << '\n';
break;
}
}
return 0;
}
