#include <iostream> #include <cstdio> #include <algorithm> #define N 110 #define M 5000 using namespace std; int n, m, u[M], v[M], w[M], r[M], p[N]; bool cmp(int i, int j){ return w[i]<w[j]; } int f(int x){ return p[x] == x ? x : p[x]…
//克鲁斯卡尔 #include<iostream> #include<algorithm> using namespace std; ; struct node { int begin, end, len; }cun[maxn]; int n, fa[maxn], ans, m; bool cmp(node a, node b) { return a.len<b.len; //按长度有小到大排序 } void init() { ; i <= n; i++) { fa[…
继续畅通工程 Time Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other) Total Submission(s) : 92 Accepted Submission(s) : 43 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description 省政府"畅通工程"的目标是使全省任何两个村庄间都可…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1233 还是畅通工程 Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 26151 Accepted Submission(s): 11660 Problem Description 某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的…