POJ - 1251】的更多相关文章

poj   1251  Jungle Roads  (最小生成树) Link: http://poj.org/problem?id=1251 Jungle Roads Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 23507   Accepted: 11012 Description The Head Elder of the tropical island of Lagrishan has a problem. A b…
D - Jungle Roads Time Limit:1000MS     Memory Limit:10000KB     64bit IO Format:%I64d & %I64u Submit Status Practice POJ 1251 Description The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extr…
poj 1251  && hdu 1301 Sample Input 9 //n 结点数A 2 B 12 I 25B 3 C 10 H 40 I 8C 2 D 18 G 55D 1 E 44E 2 F 60 G 38F 0G 1 H 35H 1 I 353A 2 B 10 C 40B 1 C 200Sample Output 21630 prim算法 # include <iostream> # include <cstdio> # include <cstr…
题目链接:http://poj.org/problem?id=1251 字符用%s好了,方便一点. #include <stdio.h> #include <string.h> #define INF 0x3f3f3f3f ][]; ]; ]; int n; int Prim() { memset(vis,false,sizeof(vis)); ; i<=n; i++) dis[i] = INF; ; dis[] = ; ; i<=n; i++) { ; ; j<…
1.链接地址: http://bailian.openjudge.cn/practice/1251/ http://poj.org/problem?id=1251 2.题目: 总时间限制: 1000ms 内存限制: 65536kB 描述 热 带岛屿Lagrishan的首领现在面临一个问题:几年前,一批外援资金被用于维护村落之间的道路,但日益繁茂的丛林无情的侵蚀着村民的道路,导致道路维 修开销巨大,长老会不得不放弃部分道路的维护.上图左侧图显示的是正在使用道路的简图以及每条路每个月的维修费用(单位…
链接: http://poj.org/problem?id=1251 Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 21776   Accepted: 10086 Description The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra road…
传送门: http://poj.org/problem?id=1251 http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=406 POJ RE死了,改成cin救过了..不过ZOJ原来的就能过,估计是POJ的数据多了个空格什么的. 1.prim #include<cstdio> #include<cstring> #include<iostream> using namespace std; const…
Description 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 expensi…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1251 AC代码: #include<iostream> #include<algorithm> #include<cstdio> #include<cstring> #include<queue> #include<string> #include<cmath> using namespace std; ][]; #defin…
模板题 Kruskal直接过 调试时候居然在sort(edge + 1, edge + 1 + m)上浪费好多时间... 不过本着ACMer的心态自然要测试一下两种方法分别的速度 Kruskal : Memory 392 Time 16 Prim: Memory 576 Time 16 ...........哦居然一样啊 Prim #include <cstdio> #include <cstring> #include <queue> #include <vec…