Cod sursa(job #2776796)
Utilizator | Data | 21 septembrie 2021 10:41:29 | |
---|---|---|---|
Problema | Heapuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.38 kb |
#include<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]);
}
return 0;
}