关于struct
  • 板块学术版
  • 楼主William_Takazaki
  • 当前回复14
  • 已保存回复14
  • 发布时间2022/9/27 21:31
  • 上次更新2023/10/27 09:42:59
查看原帖
关于struct
320470
William_Takazaki楼主2022/9/27 21:31

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无果

2022/9/27 21:31
加载中...