Official

F - Maximum Diameter Editorial by en_translator

Hint

The following is an example of a good tree when \(N=8\) and \(X=(1,1,1,1,2,2,3,3)\). What is more, the good tree has the maximum diameter.


3-vertex tree


What is the property of a good tree with the maximum diameter?

posted:
last update: