设为首页 加入收藏

TOP

POJ 1258 Agri-Net
2015-07-20 18:04:28 来源: 作者: 【 】 浏览:2
Tags:POJ 1258 Agri-Net

题意:就是要你求最小生成树所需的最小距离

思路:Kruskal算法

AC代码:

#include
  
   
#include
   
     #include
    
      using namespace std; #define N 125000 int u[N],v[N],w[N],r[N]; int f[520],str[520][520]; int find(int x) { if(x!=f[x]) f[x]=find(f[x]); return f[x]; } int cmp(const int x,const int y) //间接排序距离 { return w[x]
     
      

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇poj 1276 Cash Machine(多重背包.. 下一篇Codeforces 448E Divisors

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: