摘要: 题意:1.互通的城市必须算一个州内2.存在一条路径可以算一个州内1. 想到强连通缩点2.二分匹配#include#include#includeusing namespace std;#includeconst int INF = 1b?b:a;}int max(int a, int b){ ret... 阅读全文
posted @ 2014-07-05 23:37 kewowlo 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 至少加几条边让整个图变成强连通入度为零的根节点数出度为零的子节点数取最大值#include#include#includeusing namespace std;#includeint min(int a,int b){ return a>b?b:a;}int max(int a, int b){ ... 阅读全文
posted @ 2014-07-05 21:20 kewowlo 阅读(136) 评论(0) 推荐(0) 编辑
摘要: 转自九野博客:地址算法详解做强连通要注意特别是 taj 为 1 的情况#include#include#includeusing namespace std;#includeint min(int a,int b){ return a>b?b:a;}#define N 30 //N为最大点数 #... 阅读全文
posted @ 2014-07-05 19:45 kewowlo 阅读(130) 评论(0) 推荐(0) 编辑
摘要: /****************************Kruskal算法*****************************/int father[maxn],n,m;int find(int x){ if(father[x]!=x) father[x]=find(father[x]);... 阅读全文
posted @ 2014-07-05 15:02 kewowlo 阅读(200) 评论(0) 推荐(0) 编辑