rt,struct写一个operator和写cmp函数是一个意思吗?
好比说写
struct wyx{
int x,y,t;
}b[100010];
bool operator <(wyx a,wyx b){
return a.t<b.t;
}
和
struct wyx{
int x,y,t;
}b[100010];
bool cmp(wyx a,wyx b){
return a.t<b.t;
}int main(){
sort(b+1,b+1+n,cmp);
}
代码是等价的吗?
bdfs无果