![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
二分匹配
AAAAAugust
这个作者很懒,什么都没留下…
展开
-
HDU 2444
The Accomodation of StudentsTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1528 Accepted Submission(s): 743Problem Description原创 2013-07-28 22:21:35 · 589 阅读 · 0 评论 -
HDU 2426 KM
#include #include#include#include#include#include#define INF 60001#define N 1005using namespace std;int nx,ny,lx[N],ly[N],link[N],slack[N],visx[N],visy[N],w[N][N];bool DFS(int x){ int y;原创 2014-05-07 16:52:10 · 687 阅读 · 0 评论 -
HDU 1151
Air RaidTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2372 Accepted Submission(s): 1534Problem DescriptionConsider a town w原创 2013-07-26 20:33:34 · 636 阅读 · 0 评论 -
HDU 1150
Machine ScheduleTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 4 Accepted Submission(s) : 1Problem DescriptionAs we all know, m原创 2013-07-26 20:42:10 · 561 阅读 · 0 评论 -
HDU 1054
分析:二分图中的最大匹配数=最小顶点覆盖数数据比较大,可以用vector,双向#include #include#include#include#define MAXN 1505using namespace std;int n,m; //u,v数目int g[MAXN][MAXN];//编号是0~n-1的int linker[MAXN];int used[MA原创 2013-07-29 15:48:56 · 712 阅读 · 0 评论 -
HDU 2389
求最大匹配数数据比较大,hungary算法会超时,要用Hopcroft-karp算法#include #include#include#include#include#includeusing namespace std;const int MAXN=3001;struct guest{ int x,y,s;}gue[MAXN];struct umb原创 2013-08-02 21:05:53 · 746 阅读 · 0 评论 -
hdu 4619
二分匹配横着的和竖着的可能有重叠部分,有重叠部分的建一条边,求最大匹配即为最小覆盖定点数,再用总的多米诺骨牌数减去,即可求得答案;#include #include#include#include#include#define maxn 1005using namespace std;int n,m,k;int linker[maxn];原创 2013-08-02 20:32:55 · 708 阅读 · 0 评论 -
HDU 1845
求最大匹配用向量,数组会超内存双向,除二hungary算法#include #include#include#include#includeusing namespace std;const int MAXN=5001;vector g[MAXN];int uN,vN; //u,v数目int linker[MAXN];bool used[MAXN];原创 2013-08-02 22:24:47 · 1181 阅读 · 0 评论 -
HDU 1281
求最大匹配和必要点求必要点,一个个枚举,判断去掉这个点之后最大匹配数是否变化#include #include#include#include#define N 105using namespace std;int n,m,k;int g[N][N];int linker[N];bool usde[N];bool dfs(int u){ int v;原创 2013-08-02 16:25:21 · 632 阅读 · 0 评论 -
HDU 3435 A new Graph Game
#include #include#include#include#include#include#define INF 60001#define N 1005using namespace std;int nx,ny,lx[N],ly[N],link[N],slack[N],visx[N],visy[N],w[N][N];bool DFS(int x){ int y;原创 2014-05-07 16:27:53 · 641 阅读 · 0 评论