ACM: 图论题 poj 1…
来源:互联网 发布:java酒店管理系统程序 编辑:程序博客网 时间:2024/05/18 22:42
Description
- every student in the committee represents a different course (astudent can represent a course if he/she visits thatcourse)
- each course has a representative in the committee
Input
P N
Count1 Student1 1 Student1 2 ...Student1 Count1
Count2 Student2 1 Student2 2 ...Student2 Count2
...
CountP StudentP 1 StudentP 2 ...StudentP CountP
The first line in each data set contains two positive integersseparated by one blank: P (1 <= P <=100) - the number of courses and N (1 <= N<= 300) - the number of students. The next P linesdescribe in sequence of the courses �from course 1 to course P,each line describing a course. The description of course i is aline that starts with an integer Count i (0 <= Counti <= N) representing the number of students visitingcourse i. Next, after a blank, you抣l find the Count i students,visiting the course, each two consecutive separated by one blank.Students are numbered with the positive integers from 1 to N.
There are no blank lines between consecutive sets of data. Inputdata are correct.
Output
Sample Input
2
3 3
3 1 2 3
2 1 2
1 1
3 3
2 1 3
2 1 3
1 1
Sample Output
YES
NO
题意: 每一个学生可能有多个选择去的课程, 但是每个人只能去一个, 问每门课是否都有学生去.
解题思路:
代码:
#include <cstdio>
#include <iostream>
#include <cstring>
using namespace std;
#define MAX 305
int P, N;
bool g[MAX][MAX], vis[MAX];
int y[MAX];
bool find(int u)
{
}
bool Edmonds()
{
}
int main()
{
//
}
- ACM: 图论题 poj 1…
- ACM: 图论题 poj 1…
- ACM: 图论题 poj 3…
- ACM: 图论题 poj 2240 (floyd + ST…
- ACM: 简单最小生成树 图论题 poj 1…
- ACM: 匈牙利算法 图论题 poj 3041 …
- ACM: 差分约束 图论题 poj 2983 sp…
- ACM: 有向欧拉图 图论题 poj 1386 …
- ACM: 图论题 poj 2253 (poj上的dou…
- ACM: 图论题 poj 1135
- ACM: 二分图最佳匹配 图论题 poj 3…
- ACM: 二分图最大匹配 图论题 poj 2…
- ACM: 图论题 poj 1161 (把图重建成…
- ACM: 图论题 poj 1789 (一次AC的水…
- ACM: 图论题 poj 1125 (题意读好久…
- ACM: 图论题 poj 1062 (邻接矩阵+d…
- ACM: 最小费用最大流 图论题 poj 2…
- ACM: 图论题+记忆DP poj 2662 (边…
- ACM: 图论题 poj 1236 强连通
- ACM: 图论题 poj 1275 差分约束题
- 图论: 差分约束系统
- ACM: 图论题 poj 1…
- ACM: 图论题 poj 1466 最大独立团
- ACM: 图论题 poj 1…
- ACM: 动态规划题 sicily…
- ACM: 动态规划题 《黑书…
- CSDN博客关注点
- ACM: 动态规划题 poj&nb…
- ACM: 金华赛区题目 水题…
- ACM: 华东师范oj 1600&n…
- ACM: 动态规划题 poj&nb…
- ACM: 计算几何题 poj 2066