#include
using namespace std;
int n;
double x[105],y[105];
double d[105];
int used[105];
double ma[105][105];
double mst(){
d[0] = 0.0;
double ans = 0.0;
for(int i = 0;i < n;i++){
double min =...
分类:
其他好文 时间:
2015-05-16 10:34:20
阅读次数:
115
题目描述:
In an episode of the Dick Van Dyke show, little Richie connects the freckles on his Dad's back to form a picture of the Liberty Bell. Alas, one of the freckles turns out to be a scar, so ...
分类:
其他好文 时间:
2014-11-19 02:00:43
阅读次数:
261
解题报告
题意:
把所有点连起来,求使用的墨水最少。
思路:
裸最小生成树。
#include
#include
#include
#include
#define inf 0x3f3f3f3f
using namespace std;
struct N {
double x,y;
} node[110];
int vis[110],n;
double mmap[110]...
分类:
其他好文 时间:
2014-08-19 11:02:54
阅读次数:
255
Problem A: FrecklesIn an episode of the Dick Van Dyke show, little Richie connects the freckles on his Dad's back to form a picture of the Liberty Bel...
分类:
其他好文 时间:
2014-08-16 21:03:41
阅读次数:
319
1 /* 2 10034 - Freckles 3 克鲁斯克尔最小生成树!~ 4 */ 5 #include 6 #include 7 #include 8 #include 9 using namespace std;10 11 struct node{12 double x, y;13...
分类:
其他好文 时间:
2014-08-08 01:54:15
阅读次数:
234
本题是求最小生成树。
给出的是坐标节点,然后需要根据这些坐标计算出各个点之间的距离。
除此就是标准的Prime算法了,能使用Prime的基本上都可以使用Kruskal。
这些经典的算法一定要多写,熟练掌握,否则很难灵活运用的。
而且经典的算法之所以为经典,原因之一是没那么容易自己凭空想象出来的,所以要熟练。
#include
#include
#include
#include ...
分类:
其他好文 时间:
2014-07-06 00:22:21
阅读次数:
338