Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: The Bonus Salary!
Description In order to encourage employees' productivity, ACM Company has made a new policy. At the beginning of a period, they give a list of tasks to each employee. In this list, each task is assigned a "productivity score". After the first Due to the difficulty of tasks, for task - It must be done from
*hh_L*:_{i}*mm_L*:_{i}*ss_L*to_{i}*hh_R*:_{i}*mm_R*:_{i}*ss_R*._{i} - This range of time is estimated very strictly so that anyone must use all of this time to finish the task.
Moreover, at a moment, each employee can only do at most one task. And as soon as he finishes a task, he can start doing another one immediately. XYY is very hard-working. Unfortunately, he's never got the award. Thus, he asks you for some optimal strategy. That means, with a given list of tasks, which tasks he should do in the first Input The first line contains 2 integers
mm_L:_{i}ss_L _{i}hh_R:_{i}mm_R:_{i}ss_R _{i}wWhich means, the mm_L : _{i}ss_L to _{i}hh_R : _{i}mm_R : _{i}ss_R and its productivity score is _{i}w. (0 ≤hh_L, _{i}hh_R ≤ 23, 0 ≤_{i}mm_L, _{i}mm_R, _{i}ss_L, _{i}ss_R ≤ 59, 1 ≤ _{i}w ≤ 10000). We use exactly 2 digits (possibly with a leading zero) to represent hh, mm and ss. It is guaranteed that the moment hh_R : _{i}mm_R : _{i}ss_R is strictly later than _{i}hh_L: _{i} mm_L : _{i}ss_L. _{i}Output The output only contains a nonnegative integer --- the maximum total productivity score. Sample Input 5 2 09:00:00 09:30:00 2 09:40:00 10:00:00 3 09:29:00 09:59:00 10 09:30:00 23:59:59 4 07:00:00 09:31:00 3 Sample Output 16 Hint The optimal strategy is: Source |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator