Tree Path problem

Правка en1, от W--o_o--W, 2018-11-24 17:24:38

Hello,

I came up with the following problem but I'm not sure if it is possible to solve it in less than O(n2), any ideas?

You are given a weighted tree with n nodes and you are allowed to swap the costs (1 ≤ cost ≤ n) of two edges at most once such that the sum of all paths in the tree is maximum.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский W--o_o--W 2018-11-24 17:24:38 337 Initial revision (published)