优先队列排序
自定义优先队列是从大到小的;
priority_queue<int>a;
从小到大排序则是;
struct cmp{ bool operator()(int x,int y) { return x>y; } }; priority_queue<int,vector<int>,cmp>a;
结构体排序
struct node{ int x,y; }; bool operator(const node &a,const node &b) { return a.x>b.x; }; priority_queue<node>a;