摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4179思路:不知道怎么回事,wa了n多次,然后不知道怎么回事就过了==,还是简单的说一下思路吧:一次以起点为源点跑一遍spfa,然后以终点为起点跑一次spfa,这样我们就可以枚举difficult为maxdist的边了,设该边的端点为x,y,于是有ans=min(ans,dist1[x]+Get_Dist(x,y)+dist2[y])。 1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 #i 阅读全文
posted @ 2013-06-13 15:34 ihge2k 阅读(443) 评论(0) 推荐(0) 编辑