萌新刚学结构体求助
  • 板块学术版
  • 楼主wtxy2006
  • 当前回复19
  • 已保存回复19
  • 发布时间2020/6/20 12:57
  • 上次更新2023/11/7 00:20:15
查看原帖
萌新刚学结构体求助
289573
wtxy2006楼主2020/6/20 12:57

RT,为什么用优先队列会报编译错误。

struct things {
  int v, m;

  inline bool operator<(const things& t2) { return this->v < t2.v; }
  inline bool operator==(const things& t2) { return this->v == t2.v; }
} a[MN];
inline bool cmp(things t1, things t2) {
  return t1.m == t2.m ? t1.v > t2.v : t1.m < t2.m;
}
priority_queue<things> q;
2020/6/20 12:57
加载中...