POJ1274_The Perfect Stall(二部图最大匹配)
解决报告
http://blog.csdn.net/juncoder/article/details/38136193
题意:
n头m个机器,求最大匹配。
ps
一分钟前刚做了POJ1469直接改了输入输出就交了,题意全然一样,,,sad ,代码传送门
| Time Limit: 1000MS | Memory Limit: 10000K | |
| Total Submissions: 18108 | Accepted: 8227 |
Description
it quickly became clear that any given cow was only willing to produce milk in certain stalls. For the last week, Farmer John has been collecting data on which cows are willing to produce milk in which stalls. A stall may be only assigned to one cow, and,
of course, a cow may be only assigned to one stall.
Given the preferences of the cows, compute the maximum number of milk-producing assignments of cows to stalls that is possible.
Input
to a single cow. The first integer (Si) on the line is the number of stalls that the cow is willing to produce milk in (0 <= Si <= M). The subsequent Si integers on that line are the stalls in which that cow is willing to produce milk. The stall numbers will
be integers in the range (1..M), and no stall will be listed twice for a given cow.
Output
Sample Input
5 5
2 2 5
3 2 3 4
2 1 5
3 1 2 5
1 2
Sample Output
4
版权声明:本文博主原创文章,博客,未经同意不得转载。
POJ1274_The Perfect Stall(二部图最大匹配)的更多相关文章
- POJ1274 The Perfect Stall[二分图最大匹配]
The Perfect Stall Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 23911 Accepted: 106 ...
- POJ1274 The Perfect Stall[二分图最大匹配 Hungary]【学习笔记】
The Perfect Stall Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 23911 Accepted: 106 ...
- poj--1274--The Perfect Stall(最大匹配)
The Perfect Stall Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 21665 Accepted: 973 ...
- poj1274 The Perfect Stall (二分最大匹配)
Description Farmer John completed his new barn just last week, complete with all the latest milking ...
- [POJ] 1274 The Perfect Stall(二分图最大匹配)
题目地址:http://poj.org/problem?id=1274 把每个奶牛ci向它喜欢的畜栏vi连边建图.那么求最大安排数就变成求二分图最大匹配数. #include<cstdio> ...
- Luogu 1894 [USACO4.2]完美的牛栏The Perfect Stall / POJ 1274 The Perfect Stall(二分图最大匹配)
Luogu 1894 [USACO4.2]完美的牛栏The Perfect Stall / POJ 1274 The Perfect Stall(二分图最大匹配) Description 农夫约翰上个 ...
- POJ1274:The Perfect Stall(二分图最大匹配 匈牙利算法)
The Perfect Stall Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 17895 Accepted: 814 ...
- USACO Section 4.2 The Perfect Stall(二分图匹配)
二分图的最大匹配.我是用最大流求解.加个源点s和汇点t:s和每只cow.每个stall和t 连一条容量为1有向边,每只cow和stall(that the cow is willing to prod ...
- usaco training 4.2.2 The Perfect Stall 最佳牛栏 题解
The Perfect Stall题解 Hal Burch Farmer John completed his new barn just last week, complete with all t ...
随机推荐
- hdu3006(状态压缩)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3006 题意:给定一些集合,求这些集合所能组合的集合个数. 分析:这题就是用一个二进制数保存一个集合的元 ...
- hdu2062(递推)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2062 详细分析:http://mamicode.com/info-detail-95273.html ...
- Android数据库hibernate框架
说明 /** * YDL_Hibernate总结 <br/> * (一)支持功能: 1.自己主动建表,支持属性来自继承类:可依据注解自己主动完毕建表,而且对于继承类中的注解字段也支持自己主 ...
- SE 2014年4月3日
一 OSPF协议都支持哪些特殊区域?每种特殊区域都有什么特点. OSPF协议支持的特殊区域主要有stub区域.totally stub区域以及nssa区域,其中stub区域一般出现在末梢网络,即它的 ...
- eclipse 安装vrapper vim插件
http://vrapper.sourceforge.net/update-site/stable 如果安装不上,设置下代理./window/pereference/network* - manul
- 阅读zepto.js的core中的Core methods
学习zepto.js,參考资料:http://www.zeptojs.cn/ 跟jQuery一样.其选择符号也是$; 首先接触的是 $.() 选择 $(selector, [context]) ⇒ ...
- Python重写C语言程序100例--Part6
''' [程序41] 题目:学习static定义静态变量的使用方法 1.程序分析: 2.程序源码: ''' # python没有这个功能了,仅仅能这样了:) def varfunc(): var = ...
- SQLserver2012 tcp/ip 1433port问题解决方法
非常多MSSQL安装完毕后,调用1433(默认port)是失败的,这边具体介绍下解决方法. 一..我们须要在电脑上开启telnet服务,定位问题须要.在cmd下使用telnet,假设报命令不存在说明没 ...
- struts2集成fckeditor(来自大型门户网站是这样练成的一书)
- codeforces293E (树上点分治+树状数组)
和poj1747相比起来,只不过是限制条件多了一维. 而多了这一维,所以需要用树状数组来维护,从而快速得到答案. 因为没注意传进树状数组函数的参数可能是<=0的,导致超时了好久. #pragma ...