题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3371 Connect the Cities Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 10313 Accepted Submission(s): 2937 Problem Description In 2100, since th…
Connect the Cities Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 16070 Accepted Submission(s): 4177 Problem Description In 2100, since the sea level rise, most of the cities disappear. Thou…
Agri-Net Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 64912 Accepted: 26854 Description Farmer John has been elected mayor of his town! One of his campaign promises was to bring internet connectivity to all farms in the area. He nee…
一直以来只会Kruskal prim和dijkstra很像 只不过prim维护的是最短的边,而dijkstra维护的是最短的从起点到一个点的路径 同时prim要注意当前拓展的边是没有拓展过的 可以用堆优化 #include<bits/stdc++.h> #define REP(i, a, b) for(register int i = (a); i < (b); i++) #define _for(i, a, b) for(register int i = (a); i <= (b…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=3371 Problem Description In 2100, since the sea level rise, most of the cities disappear. Though some survived cities are still connected with others, but most of them become disconnected. The governmen…