Intersecting Path question in codechef JUNE long challenge

Правка en1, от carnage17, 2019-06-17 17:53:47

Here is the problem link and problem statement is pretty short you can have a go at it. I was able to get 30 points on this question and then I thought if there is a way to order the queries to reduce time complexity but wasn't able to come up with anything.

Even though the editorial is pretty clear I am not able to understand it, Can someone share their approach on how to solve this problem.

Теги path query, #trees, lca, codechef long

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский carnage17 2019-06-17 17:54:29 6 Tiny change: 'o at it.\nI was ab' -> 'o at it.\n<br>\nI was ab'
en1 Английский carnage17 2019-06-17 17:53:47 511 Initial revision (published)