https://www.luogu.org/problemnew/show/P3386 可以只做一边的匹配 #include <bits/stdc++.h> using namespace std; ; vector<int> G[maxN]; int match[maxN]; int vis[maxN]; int n, m, e, sum; int dfs(int u) { ; i < G[u].size(); i++) { int v = G[u][i]; //有路而且没…
二分图匹配模板题 #include <bits/stdc++.h> #define FOPI freopen("in.txt", "r", stdin); #define FOPO freopen("out.txt", "w", stdout); using namespace std; typedef long long LL; + ; int n, k, x, y; int link[maxn], vis[ma…
onsider a group of N students and P courses. Each student visits zero, one or more than one courses. Your task is to determine whether it is possible to form a committee of exactly P students that satisfies simultaneously the conditions: . every stud…
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1179 题目大意: 有n个人要去买魔杖,有m根魔杖(和哈利波特去买魔杖的时候一样,是由魔杖选人).接下来是m行,每行第一个数k是第i根魔杖可以选的人数,接着k个数表示这根魔杖选的人的编号.最后问老板最多能卖出多少根魔杖.这个赤裸裸的模版题,套下就OK了. #include<bits/stdc++.h> using namespace std; typedef long long ll; + ; c…