
并查集
文章平均质量分 60
xtulollipop
这个作者很懒,什么都没留下…
展开
-
Information Sharing zoj3641 并查集
Description There is going to be a test in the kindergarten. Since the kids would cry if they get a low score in the test, the teacher has already told every kid some information about the test in adv原创 2015-08-03 14:14:53 · 516 阅读 · 0 评论 -
hdu2473 Junk-Mail Filter 并查集+删除节点+路径压缩
DescriptionRecognizing junk mails is a tough task. The method used here consists of two steps: 1) Extract the common characteristics from the incoming email. 2) Use a filter matching the set of原创 2015-08-17 13:51:16 · 667 阅读 · 0 评论 -
hdu 1213 How Many Tables 并查集
Problem Description Today is Ignatius’ birthday. He invites a lot of friends. Now it’s dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all the friend原创 2015-08-17 14:31:46 · 426 阅读 · 0 评论 -
hdu1162 Eddy's picture 并查集+最小生成树
Problem Description Eddy begins to like painting pictures recently ,he is sure of himself to become a painter.Every day Eddy draws pictures in his small room, and he usually puts out his newest pictur原创 2015-08-17 21:03:18 · 395 阅读 · 0 评论 -
hdu1875 畅通工程再续 并查集+kruskal最小生成树
Problem Description 相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在符合条件的小岛间建上桥,所谓符合条件,就是2个小岛之间的距离不能小于10米,也不能大于1000米。原创 2015-08-17 20:40:32 · 667 阅读 · 0 评论 -
hdu1233还是畅通工程 最小生成树(prim或kruskal)
Problem Description 某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。Input 测试输入包含若干测试用例。每个测试用例的第1行给出村庄数目N ( < 100 );随后的N(N-1)/2行对原创 2015-08-17 16:35:36 · 628 阅读 · 0 评论 -
hdu1863 畅通工程 并查集+最小生成树
Problem Description 省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省畅通需要的最低成本。Input 测试输入包含若干测试用例。每个测试用例的第1行给出评估的道路条数 N、村庄数目M ( < 100 );随后的原创 2015-08-17 16:51:50 · 667 阅读 · 0 评论