Cody

Problem 45416. Don't be Greedy!

A list of assignments is given to the students along with the submission deadlines. Each of the assignment contains particular marks.

If the student can submit a particular assignment within its deadline, he'll get marks.

But he can submit only one assignment per day.

For instance,

 Assignment = [ a1, a2, a3, a4, a5, a6]
 Marks      = [ 60,100, 20, 40, 20, 10]
 Deadline   = [  2,  1,  3,  2,  1,  3]

Now, on the 1st day - he can submit one among all the assignments. But in the 2nd day, he can no longer submit a2 & a5.

He wants to achieve maximum marks by carefully submitting those assignments within the deadlines. Can u help him?

The answer should be - [a2,a1,a3]. Since by submitting in this sequence, he can get the maximum marks.

Solution Stats

5.19% Correct | 94.81% Incorrect
Last Solution submitted on Apr 08, 2020

Problem Comments

Problem Recent Solvers4

Suggested Problems

More from this Author145

Problem Tags