SPOJ QTREE4

Revision en1, by fsociety00, 2018-06-08 12:08:41

Need help! I am tried to solve SPOJ QTREE4. I used centroid decomposition, but still getting TLE (time limit exceeded). In my code, a query is processed in O(log(n)^2). How can I improve complexity? Any suggestions. Here is my code.

Tags centroid decomposition, #trees, spoj

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English fsociety00 2018-12-01 17:11:04 3 Tiny change: 'd help! I am tried to ' -> 'd help! I tried to '
en1 English fsociety00 2018-06-08 12:08:41 327 Initial revision (published)