Editorial for DMOPC '14 Contest 3 P3 - Not Enough Personnel!


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.

Author: quantum

Store all the veterans into a list, then for every single new employee with skill level s and adaptability factor d, find all veterans whose skill level, t, such that s \le t \le s + d. Then, take the min of the list based on skill level. You might need to use a stable sort if your language's min function doesn't return the first element with minimum value.


Comments

There are no comments at the moment.