
KM
吴俊达9812
这个作者很懒,什么都没留下…
展开
-
hdu 3718 Similarity
#include <bits/stdc++.h>using namespace std;typedef long long LL;typedef int lint;const int maxn = 10005;const lint inf = 0x3f3f3f3f;namespace KM { const int N = 505; int n,m; ...原创 2019-11-01 16:52:53 · 173 阅读 · 0 评论 -
hdu 2853 Assignment
思路:我们把所有边权扩大100倍,然后将原来有的边边权+1,用来处理相等的情况。#include <bits/stdc++.h>using namespace std;typedef long long LL;typedef int lint;namespace KM { const int N = 505; const lint inf = 0x3f3f...原创 2019-11-01 16:12:57 · 139 阅读 · 0 评论 -
hdu 2426 Interesting Housing Problem(KM模板)
判断不可行 + 左右点数不同的模板#include <bits/stdc++.h>using namespace std;typedef long long LL;typedef int lint;namespace KM { const int N = 505; const lint inf = 0x3f3f3f3f; int n,m; ...原创 2019-11-01 15:52:52 · 136 阅读 · 0 评论 -
hdu 1853 Cyclic Tour (KM模板)
思路:有向图中每个点存在且仅存在于一个环中:每个点出度为1,入度为1.#include <bits/stdc++.h>using namespace std;typedef long long LL;typedef LL lint;const int maxn = 205;const lint inf = 0x3f3f3f3f3f3f3f3f;namespace KM...原创 2019-10-30 23:38:58 · 118 阅读 · 0 评论 -
hdu 6346 整数规划 (KM算法模板)O(n^3)
题意:度度熊有一个可能是整数规划的问题:给定 n×n 个整数 ai,j(1≤i,j≤n),要找出 2n 个整数 x1,x2,…,xn,y1,y2,…,yn 在满足 xi+yj≤ai,j(1≤i,j≤n) 的约束下最大化目标函数 ∑ni=1xi+∑ni=1yi,你需要帮他解决这个整数规划问题,并给出目标函数的最大值。思路:这是一类可以用KM算法解决的特殊线性规划的问题。...原创 2019-10-30 20:57:30 · 362 阅读 · 0 评论