/************************************************************************/ /* hdu 1879 继续畅通工程 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 6017 Accepted Submission(s): 2493 Problem Description…
HDU 1233(最小生成树 模板) #include <iostream> #include <algorithm> #include <cstdio> using namespace std; typedef struct { int a,b; int v; }node; const int maxn=105; int ans; int father[maxn]; node graph[maxn*(maxn-1)/2]; int Find(int x) { if(f…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1879 继续畅通工程 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 14075 Accepted Submission(s): 6136 Problem Description 省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公…
继续畅通工程 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 12717 Accepted Submission(s): 5506 Problem Description 省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可).现得到城镇道路统计表,表中列出了任意两城…
#include<stdio.h> #include<math.h> #include<string.h> +,MAX=1e7; int vis[qq]; int lowcost[qq][qq]; int minimum[qq]; int n; void prim() { int minx,k; ; vis[]=; ;i<=n+;++i) minimum[i]=lowcost[][i]; ;i<n;++i){ minx=MAX; ;j<=n;++j)…