Choose the best route
摘要:
hdu 2680:http://acm.hdu.edu.cn/showproblem.php?pid=2680这道题值得一提的两点:在图论中注意重边问题是必须的,有向无向也是同等重要的,如这道题 from station p to station q说的就很清楚是有向图此题如果暴力求解把每个临近的车站都作为源点走一遍,就会超时。此时的做法是在与临近的车站加上一个0,并使其的距离为零,这样就可以转化成单源点的问题#include#include#include#includeusing namespace std;const int maxint=1008;int dist[maxint];in 阅读全文
posted @ 2013-10-03 10:15 天依蓝 阅读(134) 评论(0) 推荐(0) 编辑