最小生成树板子题 直接上kruskal即可 #include <bits/stdc++.h> using namespace std; int n,m,cnt = 0; struct gra{ int x,y,edge; }G[500005]; int fa[100005]; bool comp(gra a,gra b){ return a.edge < b.edge; } int find(int x){ //寻找父节点 return fa[x] == x ? x : fa[x] = find(fa[x]); } void Merge(int x,int y){ //合并操...