(beginer) 网络流(区间模型+最大费用流) UVA 1317 Concert Hall Scheduling
来源:互联网 发布:excel筛选出多个数据 编辑:程序博客网 时间:2024/06/05 21:00
You are appointed director of a famous concert hall, to save it from bankruptcy. The hall is very popular, and receives many requests to use its two fine rooms, but unfortunately the previous director was not very efficient, and it has been losing money for many years. The two rooms are of the same size and arrangement. Therefore, each applicant wishing to hold a concert asks for a room without specifying which. Each room can be used for only one concert per day.
In order to make more money, you have decided to abandon the previous fixed price policy, and rather let applicants specify the price they are ready to pay. Each application shall specify a period [i, j] and an asking price w, where i and j are respectively the first and last days of the period (1ij365), and w is a positive integer in yen, indicating the amount the applicant is willing to pay to use a room for the whole period.
You have received applications for the next year, and you should now choose the applications you will accept. Each application should be either accepted for its whole period or completely rejected. Each concert should use the same room during the whole applied period.
Considering the dire economic situation of the concert hall, artistic quality is to be ignored, and you should just try to maximize the total income for the whole year by accepting the most profitable applications.
Input
The input has multiple data sets, each starting with a line consisting of a single integer n, the number of applications in the data set. Then, it is followed by n lines, each of which represents one application with a period [i, j] and an asking price w yen in the following format.
i j w
A line containing a single zero indicates the end of the input.
The maximum number of applications in a data set is one thousand, and the maximum asking price is one million yen.
Output
For each data set, print a single line containing an integer, the maximum total income in yen for the data set.
Sample Input
41 2 102 3 103 3 101 3 1061 20 10003 25 100005 15 500022 300 550010 295 90007 7 6000832 251 2261123 281 1339211 235 5641162 217 727322 139 7851194 198 9190119 274 878122 173 86400
Sample Output
302550038595
- (beginer) 网络流(区间模型+最大费用流) UVA 1317 Concert Hall Scheduling
- uva 1317 - Concert Hall Scheduling(最小费用最大流)
- uva 1317 poj 2047 Concert Hall Scheduling(费用流)
- UVA 1317 - Concert Hall Scheduling(网络流)
- LA 2796 Concert Hall Scheduling 费用流
- [POJ2047] Concert Hall Scheduling && 费用流
- (beginer) 最小费用最大流 UVA 10806 - Dijkstra, Dijkstra.
- (beginer) 网络流(最小费用流+费用跟流量有关) UVA 1486 - Transportation
- POJ2047-Concert Hall Scheduling
- Concert Hall Scheduling UVALive
- (beginer) 网络流(最大流+二分) UVA 1345 - Jamie\'s Contact Groups
- (beginer)网络流(最小割最大流) UVA 1212 - Duopoly
- (beginer) 网络流(拆点+时序模型) UVA 1161 - Objective: Berlin
- poj 2047 Concert Hall Scheduling
- POJ-2047-Concert Hall Scheduling
- [TOJ 2663] Concert Hall Scheduling
- (beginer) 网络流(拆点) UVA 563 Crimewave
- (beginer) UVA 最小费用流 1349Optimal Bus Route Design
- (beginer) 网络流(最大流+二分) UVA 1345 - Jamie\'s Contact Groups
- 《将博客搬至CSDN》
- (beginer) 网络流(拆点+时序模型) UVA 1161 - Objective: Berlin
- (beginer) 网络流(拆点)UVA 12125 - March of the Penguins
- (beginer)网络流(最小割最大流) UVA 1212 - Duopoly
- (beginer) 网络流(区间模型+最大费用流) UVA 1317 Concert Hall Scheduling
- (beginer) 网络流(最小费用流+费用跟流量有关) UVA 1486 - Transportation
- (beginer) 网络流 UVA 10249 - The Grand Dinner
- OOC源码(二)
- C++中的引用
- CSS中不为人知Zoom属性的使用介绍(IE私有属性)
- mj评《大闹天宫》-8分
- 走出浮躁的泥沼
- 解决内部容器float浮动后不能撑开外部容器及CSS伪类:after的使用