[Huawei OD test questions] maximum reward (maximum profit) (python) 100% pass rate super detailed code comment code interpretation

[Huawei OD machine test real questions 2022&2023] real test catalog @click here @
[Huawei OD machine test real questions] signal transmission and reception & trial reading & @click here @
[Huawei OD machine real test questions] rent a car to ride the greenway & trial reading & @点here@

maximum reward

Work Arrangement
Knowledge Points Loop Array Greedy Dynamic Programming
Time Limit: 1s Space Limit: 32MB Limit Language: Unlimited

topic description

Xiaoming will get his own work list every week when he goes to work. The work list contains n tasks. Each task has a corresponding time-consuming time (unit h) and remuneration. The total remuneration of the job is the sum of the remuneration of all completed tasks. . Then please help Xiaoming arrange his work to ensure that Xiaoming can maximize his income during the specified working hours.

Enter a description:

The first line of input is two positive integers T, n. T represents the working time (unit h, 0< 100000) n represents the number of work (1< n <3000).
Next are n lines, each

Guess you like

Origin blog.csdn.net/weixin_45541762/article/details/130672586