Блог пользователя rguy23

Автор rguy23, история, 30 часов назад, По-английски

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.

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится