http://poj.org/problem?id=1258 这道题是最简单的一个啦,,,, #include<stdio.h> #include<iostream> #include<string.h> #include<algorithm> using namespace std; ; #define M 0x3f3f3f3f///设置无穷大的数M,当两点之间无法联通时设两者之间距离为M int ma[N][N],low[N],vis[N];///ma记…
题目链接:http://poj.org/problem?id=1258 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 needs your help, of course. Farmer John ordered a high speed…
Problem A Time Limit : 1000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other) Total Submission(s) : 31 Accepted Submission(s) : 10 Problem Description 省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可).经过调查评估,得到的统计表中列出了有可能建设公…
//归并排序递归方法实现 #include <iostream> #include <cstdio> using namespace std; #define maxn 1000005 int a[maxn], temp[maxn]; long long ans; void MergeSort(int a[], int l, int mid, int r) { ; int i = l, n = mid, j = mid, m = r; while ( i<n &&am…