浙江大學機試-還是暢通工程

kruskal算法的使用。 開始每個節點都是獨立的根,利用並查集的思想將節點構建成樹。 #include<bits/stdc++.h> using namespace std; const int maxn = 105; struct E{ int w;//權值 int a; int b; }; E edge[maxn]; bool cmp(E x,E y){ return x.w<y.
相關文章
相關標籤/搜索