Please read the new rule regarding the restriction on the use of AI tools. ×

UltramanDecker's blog

By UltramanDecker, history, 5 hours ago, In English

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!

  • Vote: I like it
  • -1
  • Vote: I do not like it

»
5 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

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