Ship Traffic

From programming_contest
Jump to navigation Jump to search
  1. calculate the time that any given ship would start blocking the ferry in that lane, and stop blocking the ferry in that lane
  2. convert these all to times that the ferry can start, leaving us with a list of times that the start Starts getting blocked, and stops getting blocked
  3. sort this list and walk it...any time there are 0 boats blocking the ferry, check if the gap to the next ship starting to block is the longest

This is another one of those "I can't believe this is a finals problem"