Editorial for Yet Another Contest 6 P1 - No More Separation
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
Let's rephrase this problem in terms of graph theory. We are required to generate a connected graph with
Subtask 1
In this subtask, the graph is a tree. We can show that the optimal tree is a star graph, in which one node is connected to every other node. This is because there must be exactly
Time complexity:
Subtask 2
Again, there must be exactly
Time complexity:
Comments