POJ2239-Selecting Courses-(匈牙利算法)】的更多相关文章

匈牙利算法模板题 有n门课程,每门课程可能有不同一时候间,不同一时候间的课程等价. 问不冲突的情况下最多能选多少门课. 建立二分图,一边顶点表示不同课程,还有一边表示课程的时间(hash一下). #include <iostream> #include <cstring> #include <string> #include <cstdio> #include <cmath> #include <algorithm> #include…
Selecting Courses Time Limit: 1000MS   Memory Limit: 65536K       Description It is well known that it is not easy to select courses in the college, for there is usually conflict among the time of the courses. Li Ming is a student who loves study eve…
题目链接: http://poj.org/problem?id=1469 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 possible to form a committee of exactly P students that sat…
http://poj.org/problem?id=1469 COURSES Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 19419   Accepted: 7642 Description Consider a group of N students and P courses. Each student visits zero, one or more than one courses. Your task is…
题目链接:http://acm.split.hdu.edu.cn/showproblem.php?pid=1083 Time Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Problem Description Consider a group of N students and P courses. Each student visits zero, one or more than…
题目链接 N节课,每节课在一个星期中的某一节,求最多能选几节课 好吧,想了半天没想出来,最后看了题解是二分图最大匹配,好弱 建图: 每节课 与 时间有一条边 #include <iostream> #include <cstdio> #include <cmath> #include <cstring> #include <algorithm> #include <vector> using namespace std; + ; in…
主题链接: http://poj.org/problem?id=2239 题目大意: 学校总共同拥有N门课程,而且学校规定每天上12节可,一周上7天. 给你每门课每周上的次数,和哪一天哪一节 课上的.假设有多门课程在同一天同一节课上.那么你仅仅能选择当中一门.那么问题来了:最多能同一时候选多少 门课而不发生冲突呢. 输入说明: 先给你一个N.表示有N门课.接下来N行,每行第一个数字x,表示这门课每周上几节.接下来是x对数.第 一个数D表示是这一周哪一天上的,第二个数C表示是这一天哪一节课上的.…
Courses Time Limit: 20000/10000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4669    Accepted Submission(s): 2230 Problem Description Consider a group of N students and P courses. Each student visits zero, one or…
题意: P门课程,N个学生.给出每门课程的选课学生,求是否可以给每门课程选出一个课代表.课代表必须是选了该课的学生且每个学生只能当一门课程的. 题解: 匈牙利算法的入门题. #include <iostream> #include <cstring> #include <cstdio> #include <vector> using namespace std; ; int t; int k, s; int flag; int p, n; int vis[m…
Selecting Courses Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 9380   Accepted: 4177 Description It is well known that it is not easy to select courses in the college, for there is usually conflict among the time of the courses. Li Mi…