重载 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];

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-18
  • 2022-12-23
  • 2022-12-23
  • 2021-12-19
  • 2021-05-23
猜你喜欢
  • 2022-12-23
  • 2022-02-28
  • 2021-09-27
  • 2021-09-27
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案