思路:
我们直接暴力把要选的点dfs出来,然后做最小生成树就行了
c o d e code code
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int n, m, a[20], fa[20];
int head[20], tot;
int p[20], an[20];
double ans = 1000000000.0;
bool v[20];
struct node {
int from, to, next, w;
}b[1000];
void add(int x, int y, int w) {
b[++ tot] = (node)