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

Автор Lavishe, история, 12 месяцев назад, По-английски

Greetings everyone, I have a question regarding certain tree DP problems — for example, this one: https://cses.fi/problemset/task/1130. Why is it that we can arbitrarily choose node 1 as the root (rather than some other node $$$u$$$ without it affecting the final outcome?

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

»
12 месяцев назад, скрыть # |
 
Проголосовать: нравится +42 Проголосовать: не нравится

Because the value you are calculating does not depend on the root. You can find a different matching, though.