Cod sursa(job #2418400)

Utilizator AndreiDeltaBalanici Andrei Daniel AndreiDelta Data 4 mai 2019 20:46:13
Problema Heapuri Scor 40
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.25 kb
#import<bits/stdc++.h>
using namespace std;ifstream i("heapuri.in");ofstream o("heapuri.out");set<int>h;int n,k,x,p,v[200005];int main(){i>>n;while(n--){i>>x;if(x==1){i>>k;v[++p]=k;h.insert(k);}if(x==3){o<<*h.begin()<<'\n';}if(x==2){i>>k;h.erase(v[k]);}}}