又是一道最小生成树,拿来测模板;
题意:N个点,坐标给出,然后有M条路已经修好了,给出这M条路的起始点和终点,求需要再修多远的路才能得到最小生成树
题解:把已经修好的路长度算0,然后最小生成树就好了;话说我wa了一次,题目说了全部用64位的运算,我没看到,把坐标改成longlong就过了好水啊;
[cpp]
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std ;
const int MAXN = 1005 ;
struct Edge
{
int start , end ;
double length ;
} edge[MAXN * MAXN] ;
struct Point