Help in a question with Tree DP

Правка en1, от blinkshot, 2019-09-13 15:21:55

I got stuck in this question . This is the question — "You are given a tree consisting of n nodes. Your task is to determine for each node the sum of the distances from the node to all other nodes."

Any help in understanding how to apply dp here will be much appreciated.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский blinkshot 2019-09-13 15:21:55 351 Initial revision (published)