摘要: 一道简单的并查集题目,刚开始还以为是搜索的题目,又加上读错了题目,纠结了一天,直到看了E_star的解题报告;思路:先按速从小到大排序,然后两个for循环,如果从第 i 条路到第 j 条路之间的所有路能够让 i 和 j 连通,那么,这就存在一条路,且这条路的舒适度就是 两者的差值。http://acm.hdu.edu.cn/showproblem.php?pid=1598View Code 1 #include<iostream> 2 #include<cstdio> 3 #include<algorithm> 4 #include<cstring&g 阅读全文
posted @ 2011-11-24 22:35 LT-blogs 阅读(221) 评论(0) 推荐(0) 编辑