#include <algorithm> #include <iostream> #include <vector> #include <exception> void sink(std::vector<int> &base, int i) { int l = i * 2 + 1; int r = i * 2 + 2; if (base.size() <= l) { return; } if (base.size() <= r) { ...