文章

结构体排序模板(priority_queue适用)

结构体排序模板

struct node{
	long long int h,num;
}tem;
struct cmp{
	bool operator()(node a,node b){
		if(a.h==b.h) return a.num>b.num;
		return a.h<b.h;
	}
};
priority_queue<node,vector<node>,cmp>q;
License:  CC BY 4.0