Help needed for a problem based on Subtree Queries on tree

Правка en1, от _Enginor_, 2021-11-21 14:56:57

Link To Problem

Can anyone give some ideas about how can this problem be solved using Segment Trees OR any other data structure.

I have already spent more than 3 hours on this problem but I could not figure out any approach. Also I am unable to understand the editorial given :(.

Any help is appreciated !.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский _Enginor_ 2021-11-21 15:02:45 243
en1 Английский _Enginor_ 2021-11-21 14:56:57 521 Initial revision (published)