Shichikuji and Power Grid

Source: Codeforces 1245D

  1. Read the problem and summarise the task requirements.
  2. Identify the graph in the problem, and which famous graph problem is most similar to the problem we have to solve.

It is not typical to combine vertex weights and edge weights.

  1. Perform a construction to associate the cost of building a power station to an edge rather than a vertex.

  2. Design an algorithm to solve the problem.

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

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