Segment Tree With Trees?

Revision en3, by stillcoding, 2015-11-05 22:43:00

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?

Tags segment tree, #trees

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English stillcoding 2015-11-05 22:43:00 4 Tiny change: ') by x._\n__\n\n\n_2 ' -> ') by x._\n\n\n_2 '
en2 English stillcoding 2015-11-05 22:42:27 4 Tiny change: ' x._\n__\n_2 &mdas' -> ' x._\n__\n\n\n_2 &mdas'
en1 English stillcoding 2015-11-05 22:41:49 417 Initial revision (published)