![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
【最小生成树】
s哒c
这个作者很懒,什么都没留下…
展开
-
HDOJ 1863 畅通工程
http://acm.hdu.edu.cn/showproblem.php?pid=1863 题意:求最小生成树。 思路:克鲁斯卡尔算法。 代码是自己根据对克鲁斯卡尔的理解写的,可能不够精简,所以仅供参考,不足为训,还望高人指点。 #include #include #include struct ln { int a,b,c; }con[10000]; int set[1原创 2012-07-19 10:27:12 · 754 阅读 · 0 评论 -
HDOJ 1233 还是畅通工程
http://acm.hdu.edu.cn/showproblem.php?pid=1233 题意:求最小的公路总长度。 思路:克鲁斯卡尔 #include #include #include #define maxn 111 struct ln { int a,b,dis; }path[maxn*maxn]; int set[maxn]; int cmp(const void原创 2012-07-20 10:46:55 · 610 阅读 · 0 评论