Cod sursa(job #2858409)
| Utilizator | Data | 27 februarie 2022 15:03:34 | |
|---|---|---|---|
| Problema | Heapuri | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.56 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("heapuri.in");
ofstream fout("heapuri.out");
const int NMAX=200005;
int N, L, ordine[NMAX];
set<int> s;
int main()
{
fin>>N;
int t, x;
while(N--){
fin>>t;
if(t==1){
fin>>x;
ordine[++L]=x;
s.insert(x);
}
else if(t==2){
fin>>x;
s.erase(ordine[x]);
}
else{
fout<<*s.begin()<<'\n';
}
}
fin.close();
fout.close();
return 0;
}
