摘要: dfs用来求这个节点属于哪一块 用floyd求出各点间的最短距离 再求出每个节点可达到的最远距离MAX[i]以及这两个块中的最长距离a,b. 枚举当两个节点不在一块中dis = max{(dis[i][j]+MAX[i]+MAX[j]),a,b),在求出dis中最小的。View Code 1 /* 2 ID: shangca2 3 LANG: C++ 4 TASK: cowtour 5 */ 6 #include <iostream> 7 #include<cstdio> 8 #include<cstring> 9 #include<algorithm 阅读全文
posted @ 2013-04-27 11:59 _雨 阅读(189) 评论(0) 推荐(0) 编辑