Description
Given a set of n jobs where each job i has a deadline and profit associated to it. Each job takes 1 unit of time to complete and onlyone job can be scheduled at a time. We earn the profit if and only if the job is completed by its deadline. The task is to find the maximum profit and the number of jobs done.
Input
The first line of input contains an integer T denoting the number of test cases.Each test case consist of an integer N denoting the number of jobs and the next line consist

这篇博客探讨了一个优化问题,如何在每个任务都需1单位时间完成且只能同时进行一个任务的情况下,根据给定的截止日期和利润,最大化总利润。任务按利润降序排列,尝试将其安排在尽可能晚的截止日期,以便为早截止日期的任务腾出时间。通过贪心策略,使用一个数组记录每天的收益,最终输出完成的任务数量和最大利润。
最低0.47元/天 解锁文章
510

被折叠的 条评论
为什么被折叠?



