
最小生成树
文章平均质量分 78
bocmingbetter
这个作者很懒,什么都没留下…
展开
-
HDU - 1875 最小生成树
#include #include #include #include #include #include using namespace std;int fa[1000];typedef pair p;struct edge{ int come, to; double d; bool operator <(const edge &p1)原创 2017-04-13 21:48:18 · 223 阅读 · 0 评论 -
POJ - 1251 最小生成树
The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But the jungle overtakes roads relentlessly, so原创 2017-04-06 21:49:09 · 190 阅读 · 0 评论 -
POJ - 1287 最小生成树 krusal
#include #include #include using namespace std;int fa[1000];struct edge{ int come, to, cost;}d[3000];bool cmp(edge p1, edge p2){ return p1.cost < p2.cost;}int getf(int x){ if(x原创 2017-04-13 21:13:46 · 180 阅读 · 0 评论 -
POJ - 2031
题意:给你n个球,如果两个球是接触的那么连接就不花费,如果不是接触的那么就是接触的距离,很容易看出是个最小生成树的。最近对ACM有点迷茫,不知道为什么,感觉看到每个题都感觉很难,也不愿意去思考,有点脑子疼。。很无奈,不知怎么取舍,毕竟我的专业不是专攻这个的。。哎,有点无奈。#include #include #include #include #include #include #原创 2017-04-26 21:47:11 · 232 阅读 · 0 评论