stillcoding's blog

By stillcoding, history, 9 years ago, In English

Hello Codeforces

I want to represent (Tree) inside Segment Tree.

For Example: Given Tree, There are two queries:

1 — Change all the vertices value on the path from (u — v) by x.

2 — Calculate the sum for the vertices value on the path from (u — v) and print it.

I have no idea how to represent the tree inside the segment tree, any ideas?

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it