Spoj Problem GOT

Revision en2, by vk_1510, 2016-01-23 16:50:21

Hi, I was trying to solve this problem GOT . My idea was to apply Heavy Light Decomposition on Tree with Segment Tree where each node of Segment Tree stores a std::set. Complexity of each query is O(LOGN * LOGN) which gives, TLE .

So, Any Hints on how to improve the solution.

Thanks

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English vk_1510 2016-01-23 16:50:21 12 Tiny change: '.spoj.com/status/GOT/) .\' -> '.spoj.com/problems/GOT/) .\'
en1 English vk_1510 2016-01-23 16:48:24 346 Initial revision (published)