int HEAP_EXTRACT_MAX(std::vector A) { if(A.empty()) { return -1; } int max = A.pop(); MAX_HEAPIFY(A, 1); return max; }