摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3790题意 : 经典的求最短路问题。表示上午刚刚学了点并查集后,因为有场最短路的练习,就突击学习了下最短路,表示很伤的学了刘汝佳的算法竞赛书上的代码,再加上肉鸽学长的教导,终于写出了我的ACM生涯中的第一个最短路(orz...)典型的Dijkstra算法,用dis和cos两个数组分别保存距离和花费...//Danceonly #include #include #include #include using namespace std; typedef long long LL; const ... 阅读全文
posted @ 2013-07-31 17:13 cnwsycf 阅读(135) 评论(0) 推荐(0)
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2544简单题,开始学图论了。//Danceonly #include #include #include #include #include using namespace std; typedef long long LL; const int INF = 100000007; const int maxn = 100050; const double Pi = atan(1) * 4; #define MIN(a,b) (a > b ? b : a) #define MAX(a,b) (... 阅读全文
posted @ 2013-07-31 17:09 cnwsycf 阅读(126) 评论(0) 推荐(0)