众所周知,你要给结构体排序要么用 cmp,要么重载运算符,所以我想问问这有什么区别?
cmp
struct edge{ int u,v,w; bool operator <(const edge x)const{ return w<x.w; } }e[300005];
struct edge{ int u,v,w; bool operator <(edge x){ return w<x.w; } }e[300005];