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

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

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
  • Проголосовать: не нравится