
二分匹配以及KM算法
文章平均质量分 91
zzuli-dk
这个作者很懒,什么都没留下…
展开
-
hdu 1533 going home KM算法
K - Going HomeTime Limit:5000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uSubmit Status Practice HDU 1533DescriptionOn a grid map there are n little men and n houses. In each unit time原创 2016-09-15 13:14:56 · 348 阅读 · 0 评论 -
light oj 1198 贪心算法或KM算法
题目大意: 你有一支队伍要和另一支队伍打比赛,由N个人组成, 每个人都有他自己的能力点数,能力点数大则赢。贪心算法类似于田忌赛马。#include<cstdio>#include <iostream>#include<cstring>#include <algorithm>using namespace std;const int N = 100;int cmp(int a, int原创 2017-08-26 11:02:53 · 531 阅读 · 0 评论 -
hdu 6178 Monkeys dfs匹配
题意:在一个树上,把n个猴子放到k个位置,求最小的边数; 思路:求二分匹配最小顶点覆盖。范围较大,可以dfs从叶子节点往根节点选(贪心)。#include <iostream>#include <cstring>#include <algorithm>#include <cstdio>#define scan(n) FastIO::read(n)using namespace std;原创 2017-08-27 20:43:49 · 284 阅读 · 0 评论