【STL】priority_queue 的自定义排序

重载 operator< 或者自己写仿函数:

 1 typedef struct{
 2     string name;
 3     int rp;
 4 }node;
 5 
 6 bool operator <( node x, node y ){
 7     if(x.rp>y.rp) return 1;
 8     else if(x.rp==y.rp && x.name<y.name) return 1;
 9     return 0;
10 }
11 
12 priority_queue <node> q[MAXN];
原文地址:https://www.cnblogs.com/bruce27/p/4438864.html