摘要:
MiYu原创, 转帖请注明 : 转载自______________白白の屋题目地址 : http://acm.hdu.edu.cn/showproblem.php?pid=2714题目描述:[代码]Farmer John's cows enjoy reading books, and FJ has discovered that his cows produce more milk when th... 阅读全文
摘要:
Floyd-Warshall算法,简称Floyd算法,用于求解任意两点间的最短距离,时间复杂度为O(n^3)。我们平时所见的Floyd算法的一般形式如下:1voidFloyd(){2inti,j,k;3for(k=1;k<=n;k++)4for(i=1;i<=n;i++)5for(j=1;j<=n;j++)6if(dist[i][k]+dist[k][j]<dist[i][... 阅读全文