Exploration Plan

Source: Codeforces 852D

  1. Read the problem and summarise the task requirements.
  2. In this problem, we might care about distances from any of the starting cities to any of the other cities (or each other).

The problem asks us to find the shortest time in which the teams can reach K different cities. There’s no obvious way to optimise for time directly. However, this problem features a familiar problem-solving paradigm.

  1. How does the number of reachable cities vary with the time allowed?
  2. Design a criterion to test whether K cities can be reached in a given time t.
  3. Design an algorithm to solve the problem.

  4. Analyse the time complexity of your algorithm and estimate its running time.

  5. Implement this algorithm in code.
  6. Submit your program for judging!