POJ-1987 Help

Правка en1, от rguy23, 2024-12-28 08:12:44

Hi everyone, I was trying to solve this problem. You can find my code here. My complexity is $$$O(N \cdot log^2(N))$$$.

However, I am getting TLE. Can someone please help in optimizing my code? I have written appropriate comments in the DFS function. For LCA and Centroid Decomposition, I referred to this blog and took the code from here.

Please help.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский rguy23 2024-12-28 08:12:44 541 Initial revision (published)