每修好一台电脑后就逐一与之前修好的电脑进行距离计算,若距离小于等于d则加入同一集合。写的时候各种不认真,wa了好几次,应该好好批评下自己。 1 #include<cstdio> 2 #include<string.h> 3 #include<iostream> 4 #include<math.h> 5 const int maxn=1010; 6 int p[maxn],n,d,repair[maxn],k; 7 struct Node 8 { 9 double x,y;10 bool flag;11 }node[maxn];12 13 void Read More
posted @ 2013-06-12 01:23 longlongago Views(176) Comments(0) Diggs(0) Edit