#include<algorithm>
#include <functional>
using namespace std;
vector<int> a;
//建堆,建好后第一个元素最大(小)
make_heap(a.begin(),a.end(), less<int>() );
//取最大值
x=a.front();
pop_heap(a.begin(),a.end(), less<int>() );
a.pop_back(); // 删除最后一个数据
//插入元素
a.push_back(x);
push_heap(a.begin(),a.end(),cmp);
//堆排序
sort_heap(a.begin(),a.end(),cmp);
// push_heap ( begin , end ) 将最后一个元素插入堆中(堆自动调整)
// pop_heap ( begin , end ) 将第一个元素从堆中删去(堆自动调整),并放到最后
// find ( begin , end , value ) 从begin到end查找value,若找不到,返回end