Cod sursa(job #3195943)
Utilizator | Data | 22 ianuarie 2024 11:48:52 | |
---|---|---|---|
Problema | Heapuri | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.5 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("heapuri.in");
ofstream fout("heapuri.out");
vector <int> v;
set <int> s;
int main()
{
int n,c,x;
fin >> n;
v.push_back(0);
while(n--){
fin >> c;
if(c == 1){
fin >> x;
v.push_back(x);
s.insert(x);
}
else if(c == 2){
fin >> x;
s.erase(v[x]);
}
else fout << *s.begin() << "\n";
}
return 0;
}