很裸,左点阵n,右点阵m 问最大匹配是否为n #include <cstdio> #include <cstring> #include <vector> using namespace std; vector <int> edge[103]; int pre[303]; bool vis[303]; int n, m; bool dfs(int u) { for(int i = 0; i < (int)edge[u].size(); i++) { i…
COURSES Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 16877 Accepted: 6627 Description Consider 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 poss…
COURSES Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 18993 Accepted: 7486 Description Consider 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 poss…
Chessboard Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 12800 Accepted: 4000 Description Alice and Bob often play games on chessboard. One day, Alice draws a board with size M * N. She wants Bob to use a lot of cards with size 1 * 2…
题意:每头奶牛都只愿意在她们喜欢的那些牛栏中产奶,告诉每头奶牛愿意产奶的牛棚编号,求出最多能分配到的牛栏的数量. 分析:直接二分图匹配: #include<stdio.h> #include<memory.h> #define MAX 202 bool flag,visit[MAX]; //记录V2中的某个点是否被搜索过 int match[MAX]; //记录与V2中的点匹配的点的编号 int cow, stall; //二分图中左边.右边集合中顶点的数目 int head[MA…
COURSES Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 21527 Accepted: 8460 Description Consider a group of N students and P courses. Each student visits zero, one or mo…
Problem DescriptionFrank N. Stein is a very conservative high-school teacher. He wants to take some of his students on an excursion, but he is afraid that some of them might become couples. While you can never exclude this possibility, he has made so…