int getf(int x){return (f[x]==x)?x:f[x]=getf(f[x]);}
void hb(int x,int y){x=getf(x),y=getf(y),f[y]=x;}
inline void add(int u,int v,int w,int c);
int kruskal()
{
int num=;ans=;
for(int i=;i<=v;i++)f[i]=i;
sort(ed+,ed+num_e+);
for(int i=;i<=num_e;i++)
if(getf(u(i))!=getf(v(i)))
{
ans+=w(i);
hb(u(i),v(i));
if(!c(i))num++;
}
return num;
}

最新文章

  1. DOM加载过程中ready和load的区别
  2. Sql Server系列:数据库对象
  3. jquery中的$的特殊用法
  4. Beaglebone Black从零开始系列教程大汇总!
  5. BZOJ 1853: [Scoi2010]幸运数字
  6. Code Snippet
  7. 【java】: 操作excel2007/2003
  8. Linux 求文件交集 差集等
  9. 13.python笔记之pyyaml模块
  10. mediawiki 的使用
  11. easyui源码翻译1.32--DateTimeBox(日期时间输入框)
  12. 使用SharePoint管理中心管理服务
  13. KVM 虚拟化基本搭建
  14. 列表操作之定义,切片(取元素)(Python)
  15. idea web项目动态部署
  16. SecureCRT永久设置保护眼睛配色方案
  17. talk命令帮助文档(ubuntu 18.04)
  18. Fiddler抓包使用教程-基本功能介绍
  19. ubuntu git生成ssh key (公钥私钥)配置github或者码云
  20. 我的第一个网络爬虫 C#版 福利 程序员专车

热门文章

  1. 中介者模式(Mediator、ConcreteMediator、Colleague Class)(租房中介)
  2. vue+vant ui+高德地图的选址组件
  3. python 全局种子与局部种子
  4. LINUX常见服务列表
  5. win10 系统同步时间出错
  6. IntelliJ IDEA中设置同时打开多个文件且分行显示
  7. python实现统计字符类型
  8. 使用 javascript 替换 jQuery
  9. 【风马一族_Android】无线连接|调试Android手机
  10. SpringBoot Actuator监控【转】