![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
最小生成树
knownothing
这个作者很懒,什么都没留下…
展开
-
hdu 1233 还是畅通工程 最小生成树Kruskal算法(并查集)
#include #include #include #include #include using namespace std; struct node{ int a,b,w; }e[10001]; int f[101]; int cmp(node x,node y) { return x.w<y.w; } int find(int x) { if(f[x]!=原创 2013-08-28 16:01:56 · 917 阅读 · 0 评论 -
hdu 3371 Connect the Cities 最小生成树(kruskal算法)
#include #include #include #include #include #include using namespace std; const int maxn=505; const int maxm=25005; int f[maxn]; struct node{ int a,b,w; }e[maxm]; int find(int x) { if(x原创 2013-09-02 12:53:28 · 725 阅读 · 0 评论 -
hdu 3367 Pseudoforest kruskal算法的变种+并查集
#include #include #include #include #include #include using namespace std; const int maxn=10010; const int maxm=100010; int f[maxn],vis[maxn]; struct node{ int a,b,w; }e[maxm]; int find(int原创 2013-09-02 21:10:45 · 914 阅读 · 0 评论 -
hdu 4966 GGS-DDU 最小树形图/有向图的最小生成树
题意: 总共有n门课,meime原创 2014-08-21 20:31:56 · 1942 阅读 · 0 评论