Cod sursa(job #3149009)
Utilizator | Data | 5 septembrie 2023 17:56:17 | |
---|---|---|---|
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;
}