
并查集?
axcuian
这个作者很懒,什么都没留下…
展开
-
hdu 1232 畅通工程<java>
http://acm.hdu.edu.cn/showproblem.php?pid=1232 题目 题意 给出城市个数,及已联通城市,求连通图需要再建几条路 并查集 import java.util.Scanner; public class Main { public static void ma翻译 2013-01-24 11:06:27 · 592 阅读 · 0 评论 -
hdu 1598 find the most comfortable road
find the most comfortable road Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1657 Accepted Submission(s): 681 Problem Description XX星有原创 2012-10-19 14:54:29 · 537 阅读 · 0 评论 -
hdu 1233 还是畅通工程<java>
http://acm.hdu.edu.cn/showproblem.php?pid=1233 题目 题意 备注 给出城市间距离,求联通最短距离 并查集+快排 冒泡超时 import java.util.Scanner; public class Main { public static void Q翻译 2013-01-24 11:29:43 · 574 阅读 · 0 评论 -
hdu 1879 继续畅通工程
http://acm.hdu.edu.cn/showproblem.php?pid=1879 题目 题意 备注 给出道路修没修,修的代价,求最少花费,要连通图 并查集+二级排序 java冒泡排的超时(c++用结构体过了) #include #include struct date { int a,b,c,d; }s[506翻译 2013-01-24 11:39:52 · 401 阅读 · 0 评论 -
hdu 1829 A Bug's Life
http://acm.hdu.edu.cn/showproblem.php?pid=1829 题目 算法 备注 仅两只异性臭虫的存在关系,求给出的数据是否矛盾 并查集+ 同性数组[n],异性数组[n] import java.util.Scanner; public class Main { pu翻译 2013-01-26 17:10:26 · 450 阅读 · 0 评论