会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
杰登123
任风吹干流过的泪和汗 总有一天我有属于我的天
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
25
26
27
28
29
30
31
32
33
下一页
2017年7月22日
KM算法
摘要: 啊呜啊呜,看来好几天的KM浸提终于弄懂了,前两天就一直看来着,然后看不明白,就放着了,今天不信,重拾KM终于磕会了。然后,其实好傻逼,就是匈牙利算法,加了一个+d -d的过程 首先来看一个例子(hdu 2255 奔小康赚大钱) 题意: 1.村委会有n个人,n个房子 2.每个人可以为多个房子出不同的价
阅读全文
posted @ 2017-07-22 16:32 ouyang_wsgwz
阅读(193)
评论(0)
推荐(0)
2017年7月21日
hdu1102 Constructing Roads 基础最小生成树
摘要: 1 //克鲁斯卡尔(最小生成树) 2 #include 3 #include 4 #include 5 using namespace std; 6 7 const int maxn = 100005; 8 int n, t; 9 struct node 10 { 11 int bagin, end, len; 12 }arr[maxn]; 13 int fa[max...
阅读全文
posted @ 2017-07-21 20:44 ouyang_wsgwz
阅读(133)
评论(0)
推荐(0)
hdu1856 More is better 基础并查集
摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 #define MAXN 100005 8 int fa[MAXN]; //父节点 9 int vis[MAXN]; 10 int Min = 0xffffff; 11 int Max = 0; 12 13 v...
阅读全文
posted @ 2017-07-21 16:48 ouyang_wsgwz
阅读(109)
评论(0)
推荐(0)
hdu1068 Girls and Boys 基础匈牙利
摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 #define MAXN 500 8 int map[MAXN][MAXN]; 9 int mark[MAXN]; 10 int pipei[MAXN]; 11 int n; 12 13 int search(int a) 1...
阅读全文
posted @ 2017-07-21 09:47 ouyang_wsgwz
阅读(151)
评论(0)
推荐(0)
hdu1151 Air Raid 基础匈牙利
摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 #define MAXN 150 8 int n; //十字路口的数量 9 int m; //路的个数 10 int map[MAXN][MAXN]; 11 int x[MAXN], y[MAXN]; 12 int ...
阅读全文
posted @ 2017-07-21 08:51 ouyang_wsgwz
阅读(155)
评论(0)
推荐(0)
2017年7月20日
hdu1325 Is It A Tree? 基础并查集
摘要: 1 #include 2 #include 3 4 int f[1001], g[1001]; 5 6 int find(int x) //并查集的查找,找到共同的父亲 7 { 8 if (f[x] != x) 9 f[x] = find(f[x]); 10 return f[x]; 11 } 12 13 in...
阅读全文
posted @ 2017-07-20 19:11 ouyang_wsgwz
阅读(141)
评论(0)
推荐(0)
hdu1272 小希的迷宫 基础并查集
摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 const int M = 100005; 8 int a, b; 9 int father[M]; //记录父节点 10 bool circle; //判断是否存在环 11 bool visit...
阅读全文
posted @ 2017-07-20 16:18 ouyang_wsgwz
阅读(124)
评论(0)
推荐(0)
hdu1213 How Many Tables 基础并查集
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 #define MAXN 5000 9 int fa[MAXN]; //父节点 10 int Rank[MAXN]; //数的高度 11 int ans; 12 13 void init(i...
阅读全文
posted @ 2017-07-20 10:35 ouyang_wsgwz
阅读(98)
评论(0)
推荐(0)
2017年7月17日
拓扑排序
摘要: 排序,顾名思义是进行排序,那么就有一个条件,就是可以排出结果。 比如A克B,B克C,C克A,,让你从A,B,C中选择出一个最牛逼的人,,那么这题就没有答案。 所以,条件就是不能出现环状。(即充要条件就是:有向无环图(Directed Acyclic Graph 简称DAG)) 比如,现在有一个兵乓球
阅读全文
posted @ 2017-07-17 14:35 ouyang_wsgwz
阅读(142)
评论(0)
推荐(0)
最小生成树Prim算法和Kruskal算法(转)
摘要: (转自这位大佬的博客 http://www.cnblogs.com/biyeymyhjob/archive/2012/07/30/2615542.html ) Prim算法 1.概览 普里姆算法(Prim算法),图论中的一种算法,可在加权连通图里搜索最小生成树。意即由此算法搜索到的边子集所构成的树中
阅读全文
posted @ 2017-07-17 09:41 ouyang_wsgwz
阅读(166)
评论(0)
推荐(0)
上一页
1
···
25
26
27
28
29
30
31
32
33
下一页