Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

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

Автор UltramanDecker, история, 5 часов назад, По-английски

Given a tree with N nodes rooted at 1, each node has val a[i]

There are three types of queries:

1 x k v for all node y which distance to x is exactly k, add v to a[y], then output the maximum value of these a[y]

2 x k v for all node y which distance to x not exceed k, add v to a[y], then output the maximum value of these a[y]

3 x v for all node in subtree x, add v to a[y], then output the maximum value of these a[y]

It is guarantee that k is less than 10

Please help me with this problem. Thank you so much!

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

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

Auto comment: topic has been updated by UltramanDecker (previous revision, new revision, compare).