1 #include 2 #include 3 using namespace std; 4 5 const int maxn = 10005; 6 int n, m; 7 int fa[28]; 8 struct node 9 { 10 int x, y; 11 int cost; 12 }arr... ...
分类:
其他好文 时间:
2017-08-06 18:00:24
阅读次数:
165
Jungle Roads Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5591 Accepted Submission(s): 4031 P ...
分类:
其他好文 时间:
2017-08-01 17:56:46
阅读次数:
156
The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ag ...
分类:
其他好文 时间:
2017-03-19 10:57:55
阅读次数:
178
Jungle Roads
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 5591 Accepted Submission(s): 4031
Problem Description
The Head ...
分类:
其他好文 时间:
2015-08-14 09:59:44
阅读次数:
122
The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But the jungle overtakes roads relentlessly, so the large road network is too expensive to maintain. Th...
分类:
编程语言 时间:
2015-02-23 15:31:52
阅读次数:
212
题目大意:热带的一个岛上有N个村庄,还有一些路,现在丛林把道路给破坏了。酋长
想要去掉一些不必要的路,使得剩下的路既能联通全部村庄,又能使总路程最短。求:
这个最短的总路程是多少
思路:就是给你N个点,M条边,求最小生成树。用Prim算法来做,输入的时候将字母
代表的村庄转换为下标(即字母 - 'A')即可。...
分类:
其他好文 时间:
2015-01-19 22:41:24
阅读次数:
215
题目大意:给你一个用前N个村庄,村庄用字母表的前N个字母表示,接下来N-1行
表示第字母X与其相连的村庄数目,及其相连的村庄字母和两个村庄的距离,求最小
生成树。
思路:Prim模板题。...
分类:
其他好文 时间:
2014-12-25 00:16:17
阅读次数:
157
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1301依旧Prim............不多说了 1 #include 2 #include 3 #include 4 5 using namespace std; 6 7 #define MAX .....
分类:
其他好文 时间:
2014-08-23 16:36:41
阅读次数:
204
Jungle Roads
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 4268 Accepted Submission(s): 3120
Problem Description
The Head ...
分类:
其他好文 时间:
2014-07-29 17:53:22
阅读次数:
283
爽爆。史上个人最快MST的记录7分40s。。一次A。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 10 #define typec int11 us...
分类:
其他好文 时间:
2014-07-24 22:53:33
阅读次数:
247