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

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

I was recently solving dp on tree type problems and i came across this.

Problem

do you think the solution given in editorial is correct.I feel it doesnt include all the cases.He says for every vertex as root , consider all subtrees...This doesnt include all the possible Sets S. Please someone explain this to me

Thanks in advance

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

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

Can someone elaborate the centroid decomposition idea for this question.?