摘要: hdu 1598 find the most comfortable road分类上属于最短路,,不过用枚举可以水过,, 但是却没想到怎样用最短路来求。。把边的长度排序,每枚举一条边,按顺序添加比枚举边小的边到并查集, 判断起点和重点是否联通,如果是的话 ,另枚举更长的边,取最小值就可以了。。# include<stdio.h># include<string.h># include<stdlib.h># define PI 0xfffffffstruct node{ int p,q,dis;}s[1005];int father[205];int find 阅读全文
posted @ 2011-05-05 19:50 奋斗青春 阅读(137) 评论(0) 推荐(0)