Cod sursa(job #3286106)
| Utilizator | Data | 13 martie 2025 18:48:38 | |
|---|---|---|---|
| Problema | Heapuri | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva educationala | Marime | 0.55 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("heapuri.in");
ofstream fout("heapuri.out");
int n, tip, x;
vector<int> v;
multiset<int> st;
int main()
{
fin >> n;
for(int i=0; i<n; i++) {
fin >> tip;
if(tip==3) {
fout << *st.begin() << "\n";
} else {
fin >> x;
if(tip==1) {
v.push_back(x);
st.insert(x);
} else {
st.erase(st.find(v[x-1]));
}
}
}
return 0;
}
