Editorial for MWC '15 #1 P1: Playlist Panic
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
Sorting the songs based on their length in ascending order, and greedily choosing songs until the total time runs out is sufficient to solve this problem. Edge cases occur when the time limit is
Time complexity:
Comments