并查集
Seeyouer
这个作者很懒,什么都没留下…
展开
-
Codeforces Round #400 (Div. 1 + Div. 2, combined)D - The Door Problem(2-sat)
Problem Description Moriarty has trapped n people in n distinct rooms in a hotel. Some rooms are locked, others are unlocked. But, there is a condition that the people in the hotel can only es原创 2017-10-31 15:26:04 · 359 阅读 · 0 评论 -
HDU 1863 畅通工程
省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省畅通需要的最低成本。 Input 测试输入包含若干测试用例。每个测试用例的第1行给出评估的道路条数 N、村庄数目M ( < 100 );随后的 N 行对应村庄间道路原创 2017-10-17 15:26:35 · 313 阅读 · 0 评论