Editorial for ICPC NEERC 2010 E - Evacuation Plan


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.
  • Sort the team's and shelter's locations
  • The optimal assignment will assign consecutive ranges of teams to a shelter (after sorting)
  • Find the answer using two-parameter dynamic programming considering this sub-problem:
    • P(u, v) – the total fuel required to match the first u teams to the first v shelters
    • P(u, v) = |loc(u)-loc(v)|+\min(P(u-1, v-1), P(u-1, v))

Comments

There are no comments at the moment.