poj 2239 Selecting Courses (二分匹配)】的更多相关文章

Selecting Courses Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8316   Accepted: 3687 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…
http://poj.org/problem?id=2239 这里要处理的是构图问题p (1 <= p <= 7), q (1 <= q <= 12)分别表示第i门课在一周的第p天的第q节课上 其中二分图的X集合里表示课程i,那么我们要解决的就是Y集合了 将第i门课在一周的第p天的第q节课上进行编号,这样Y集合就是 上课时间的编号了 #include<stdio.h> #include<string.h> #include<math.h> #in…
poj——2239   Selecting Courses Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 10656   Accepted: 4814 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 c…
题目地址:http://poj.org/problem?id=2239 Li Ming大学选课,每天12节课,每周7天,每种同样的课可能有多节分布在不同天的不同节.问Li Ming最多可以选多少节课.把n种课划分为X集合,把一周的84节课划分为Y集合, 从Xi向Yi连边,那么就转化成了求二分图的最大匹配数,然后匈牙利算法就可以了. #include<cstdio> #include<iostream> #include<string.h> #include<alg…
二分图的最大匹配.课程和时间可以看做二分图. #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using namespace std; ; int nx,ny; int g[MAXN][MAXN]; int cx[MAXN],cy[MAXN]; int mk[MAXN]; int n; ]; int path(int u) { ; v<ny; v++) { i…
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…
题目链接:http://poj.org/problem?id=3057 题目大概意思是有一块区域组成的房间,房间的边缘有门和墙壁,'X'代表墙壁,'D'代表门,房间内部的' . '代表空区域,每个空区域站一个人,人可以向上下左右走,每走一步花费一秒钟,现在房间起火了,所有人向四周的门逃生,但是每秒钟一扇门只能通过一个人,每个人移动到门时,就算逃脱,问在选取使得所有人最优的逃生方案时,最后一个逃生的人花费多长时间?如果有人无法逃生,输出impossible. 题目建图思路比较难想.考虑到任意 t…
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…
Treasure Exploration Time Limit: 6000MS   Memory Limit: 65536K Total Submissions: 6558   Accepted: 2644 Description Have you ever read any book about treasure exploration? Have you ever see any film about treasure exploration? Have you ever explored…
T-Shirt Gumbo Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 2571   Accepted: 1202 Description Boudreaux and Thibodeaux are student volunteers for this year's ACM South Central Region's programming contest. One of their duties is to dis…