前言
这也太简单了吧hh 传送门 :
思路先计算是否有边
然后将边加入需要处理的数组里面去
跑一下最小生成树即可
CODEstruct pain{
int x,y;
}num[N];
int cal(pain a,pain b)
{
return (a.x - b.x)*(a.x-b.x) +(a.y-b.y)*(a.y-b.y);
}
struct node
{
int a,b,w;
bool operator>m;
init();
for(int i=1;i>num[i].x>>num[i].y;
}
for(int i=1;i
关注
打赏