Cod sursa(job #2925672)
Utilizator | Data | 15 octombrie 2022 21:08:04 | |
---|---|---|---|
Problema | Heapuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.35 kb |
#include<bits/stdc++.h>
using namespace std;
ifstream F("heapuri.in");
ofstream G("heapuri.out");
set<int> h;
int n,k,x,p,v[200001];
int main()
{
for(F>>n;n--;)
if(F>>x,x==1)
F>>k,v[++p]=k,h.insert(k);
else if(x==3)
G<<*h.begin()<<'\n';
else
F>>k,h.erase(v[k]);
return 0;
}