要用sort排序的话这样定义:
struct node{
int x, y;
bool operator < (const node &a)const{
return x < a.x;
}
};
普通的这样就可以啦:
struct node{
int x, y;
bool operator < (node a){
return x < a.x;
}
};
要用sort排序的话这样定义:
struct node{
int x, y;
bool operator < (const node &a)const{
return x < a.x;
}
};
普通的这样就可以啦:
struct node{
int x, y;
bool operator < (node a){
return x < a.x;
}
};