随笔分类 -  网络流

摘要:对于每首歌拆成左边和右边两组点,对于每个人擅长的歌曲,就从这个人往右边的点连边,否则连向左边的点,因为不擅长的歌最多有K个人唱,所有左边向右边连容量为K的边,然后二分最大的天数,如果对于每个天数都分派的过来的话,则是可行的一组解。 阅读全文
posted @ 2013-05-25 08:42 zhang1107 阅读(181) 评论(0) 推荐(0)
摘要:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3975View Code 阅读全文
posted @ 2013-05-09 23:03 zhang1107 阅读(173) 评论(0) 推荐(0)
摘要:[转]:http://hi.baidu.com/daizhy_acm/item/5c7e60dfcf33a1f8ca0c393eView Code 网络流题目集锦最大流 POJ 1273 Drainage Ditches POJ 1274 The Perfect Stall (二分图匹配) POJ 1698 Alice's Chance POJ 1459 Power Network POJ 2112 Optimal Milking (二分) POJ 2455 Secret Milking Machine (二分) POJ 3189 Steady Cow Assignment (枚举) 阅读全文
posted @ 2013-04-28 17:02 zhang1107 阅读(201) 评论(0) 推荐(0)
摘要:Sap模板:邻接表View Code const int MM = 555555;#define maxint 0x3f3f3f3fint N,M,K;int S,T;struct Edge { int v,w,next;}edge[MM];int head[MM],NE;void reset() {memset(head,-1,sizeof(head)),NE=0;}void add_edge(int u,int v,int c) { edge[NE].v=v, edge[NE].w=c, edge[NE].next=head[u]; head[u]=NE++; ed... 阅读全文
posted @ 2012-12-12 18:17 zhang1107 阅读(236) 评论(0) 推荐(0)