Cod sursa(job #3207002)
Utilizator | Data | 24 februarie 2024 17:55:56 | |
---|---|---|---|
Problema | Heapuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.49 kb |
#include<fstream>
#include<set>
std::ifstream fin("heapuri.in");
std::ofstream fout("heapuri.out");
int n, task, x, indice, v[200005];
std::multiset<int> S;
int main(){
fin >> n;
while(n--){
fin >> task;
if(task == 1){
fin >> x;
v[++indice] = x;
S.insert(x);
}
else if(task == 2){
fin >> x;
S.erase(v[x]);
}
else
fout << *S.begin() << '\n';
}
}