链接: http://poj.org/problem?id=2421 Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 21130 Accepted: 8924 Description There are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can…
#include<iostream> #include<cstring> #include<algorithm> using namespace std; ; int p[N]; struct edge{ int a; int b; int w; }e[N*N]; int map[N][N],flag[N][N],num,n; bool cmp(edge a,edge b) { return a.w<b.w; } int find(int x) { if(p[x]…
链接: 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…
Constructing Roads Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit Status Practice POJ 2421 Appoint description: System Crawler (2015-05-27) Description There are N villages, which are numbered from 1 to N, and y…
Constructing Roads 题目链接: http://acm.hust.edu.cn/vjudge/contest/124434#problem/D Description There are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each other. We say two villa…
Constructing Roads Description There are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each other. We say two village A and B are connected, if and only if there is a road betw…
Constructing Roads Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 19884 Accepted: 8315 Description There are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each…