Jeffin's blog

By Jeffin, history, 3 years ago, In English

Hi! I want to perform the following kind of update and query on a tree. Let all edges in the tree have unit weight and let all vertices store some value. Let this value be 0 initially.

Update:u v d which means that all nodes within a distance of d from u need to be increased by v. Query: v returns value stored in v.

I know basic applications of hld and centroid decomposition but I'm unable to use any of them for this problem. Could you guys pls help me out?

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

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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