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

Автор Jeffin, история, 3 года назад, По-английски

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?

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

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

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