i have spent days thinking about this question and still no where near to the solution
please give me a hint as to how to solve this problem
or an insight into the approach
COMRADES Problem
its a very good question.
think about the folowing steps-
- flat the tree using timein and timeout.
- now for every node to update the tree , apply a range update query with lazy propagation from from timein[cur] to timeout[cur].
and quesr.
you will understand this after studying about flattening the tree
sir, i dont know what u mean by flattening the tree by timein and timeout
its not in the course