Блог пользователя surajkvm007

Автор surajkvm007, история, 11 лет назад, По-английски

Given a forest with n vertices, add edges to make it into a tree with minimal diameter. I tried many approaches but none of them passed system test cases.Please suggest some algorithm to solve this problem.

  • Проголосовать: нравится
  • +2
  • Проголосовать: не нравится

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

The idea is to play with tree diameters while merging trees, you can use the ideas in the editorial for this problem (is very similar): http://codeforces.me/contest/455/problem/C

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

can you link the problem?

»
11 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

check the IOI 2013 Dreaming solution, it is almost the same problem.