Pagini recente » Cod sursa (job #745974) | Cod sursa (job #1633467) | Cod sursa (job #177520) | Cod sursa (job #920160) | Cod sursa (job #2900969)
#include <bits/stdc++.h>
using namespace std;
ifstream fin ("heapuri.in");
ofstream fout ("heapuri.out");
int main(){
int q , n = 0; fin >> q;
multiset<int>s;
vector<int>v;
while (q--){
int op , x; fin >> op;
if (op == 1){
fin >> x;
s.insert(x);
n += 1;
v.push_back(x);
}
if (op == 2){
fin >> x;
s.erase(v[x - 1]);
}
if (op == 3){
fout << *(s.begin()) << '\n';
}
}
}