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

10.47% Correct | 89.53% Incorrect
Last Solution submitted on Nov 08, 2023

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers8

Suggested Problems

More from this Author165

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!