需要注意,因为增加一个零点,最后总点数要加1;此模板的边和点都从0开始计数废话一句,厚积方能薄发啊。View Code #include<stdio.h>#include<stdlib.h>#include<math.h>#include<string.h>#define maxn 1005const int inf =1000000000;struct Edge{ int s,t; int cost;}edge[maxn*maxn];struct node{ int x,y,z;}a[maxn];int E,nv,ne;int pre[maxn Read More
posted @ 2011-09-06 20:07 Because Of You Views(320) Comments(0) Diggs(0) Edit
记住,这是china算法,呵呵,一丝悲哀,又有一丝欣慰第一次做,用的是矩阵版本的,但貌似对于数据更大的情况要用邻接表的,继续学习View Code #include<stdio.h>#include<math.h>#include<string.h>#define INF 100000000#define min(a,b) a<b?a:bint n,m;double map[110][110];int vis[110],pre[110];int circle[110]; struct { int x,y;}node[110];double dist(i Read More
posted @ 2011-09-06 11:44 Because Of You Views(289) Comments(0) Diggs(0) Edit