Editorial has not been posted yet.I don’t have any clue except brute force .Can some one explain the solution to the problem.
Thanks
Problem link - CodeChef: Practical coding for everyone
ssjgz
August 14, 2019, 1:20pm
2
There are @vijju123 ’s Setter’s Notes here:
Hi all,
Unfortunately, due to some personal reasons the editorials of following problems are delayed. They will be posted by end of this week tenatively
KS1 - Done
SYNBAC - Pending Approval
CHGORAM Let’s consider the euler tour of the tree and build a merge sort tree over it. Let’s consider an arbitrary vertex x as a candidate for p2. Then with the help of the merge sort tree we can calculate for every adjacent vertex the number of vertices in its subtree that are less or greater than x in O…
and also my fully-documented solution with high-level overview and lots of comments :
https://www.codechef.com/viewsolution/25925347
3 Likes