<题目链接> 题目大意: 一天有N个小时,有m个节目(每种节目都有类型),有k个人,连续看相同类型的节目会扣w快乐值.每一种节目有都一个播放区间[l,r].每个人同一时间只能看一个节目,看完可以获得快乐值,每个节目只能被人看一次.问最多可以获得多少快乐? 解题分析: 本题用费用流求解的方式还是比较直观的.因为本题要求的是最大费用,所以我们需要建图的时候需要将所有实际费用取反,然后将最后最小费用最大流求出的答案取反,就是要求的最大费用.具体建图过程见代码: #include <bits/s…
题意:M个影片,其属性有开始时间S,结束时间T,类型op和权值val.有K个人,每个人可以看若干个时间不相交的影片,其获得的收益是这个影片的权值val,但如果观看的影片相邻为相同的属性,那么收益要减少W.每个影片只能被一个人看.求所有人能获得的收益值之和的最大值. 分析:因为人数不定,所以贪心和dp的思路被否定了.1对多的带权匹配,求最大权,这种问题显然KM是解决不了的,那么只能是最小费用最大流了.而这题要求的是最大收益,那么建负权边即可. 为了保证每个影片只被一个人观看,将其拆为入点和出点,入…
Problem L.Videos Problem Description: C-bacteria takes charge of two kinds of videos: ’The Collection of Silly Games’ and ’The Collection of Horrible Games’.For simplicity’s sake, they will be called as videoA and videoB.There are some people who wan…
6343.Problem L. Graph Theory Homework 官方题解: 一篇写的很好的博客: HDU 6343 - Problem L. Graph Theory Homework - [(伪装成图论题的)简单数学题] 代码: //1012-6343-数学 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<bitset&g…
题目大意:有$n$个小时,有$m$个节目(每种节目都有类型$0/1$),有$k$个人,一个人连续看相同类型的节目会扣$w$快乐值. 每一种节目有都一个播放区间$[l,r]$.每个人同一时间只能看一个节目,第$i$个节目只能一个人看,看完可以获得快乐$val_i$.问最多可以获得多少快乐? 题解:最大费用最大流,为了保证每个影片只被一个人观看,将其拆为入点和出点,入点和出点之间连一条容量为$1$,花费为$0$的边. 建一个源点$ST$和次源点$st$.从$ST$向$st$建一条容量为$k$,花费为…
6330.Problem L. Visual Cube 这个题就是输出立方体.当时写完怎么都不过,后来输出b<c的情况,发现这里写挫了,判断失误.加了点东西就过了,mdzz... 代码: //1012-模拟乱写输出立方体 #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> #include<cmath> #include<cstdlib&g…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6343 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 262144/262144 K (Java/Others) Problem DescriptionThere is a complete graph containing n vertices, the weight of the i-th vertex is wi.The length…
Problem L.Videos Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java/Others)Total Submission(s): 455    Accepted Submission(s): 222 Problem Description C-bacteria takes charge of two kinds of videos: ’The Collection of Silly…
Coding Contest Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1751    Accepted Submission(s): 374 Problem Description A coding contest will be held in this university, in a huge playground. The…
Special Fish Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2189    Accepted Submission(s): 826 Problem Description There is a kind of special fish in the East Lake where is closed to campus of…