Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

AaZaDi's blog

By AaZaDi, history, 16 months ago, In English

Can someone explain how to find the length of the longest connected path in a graph. I have tried using the common technique, of finding the most distant node(leaf node) from any node and then find the most distant node from this leaf node using dfs twice. This is my code, don't know why this is giving RE.

Code

[problem:Problem] https://www.spoj.com/problems/PT07Z/

Read more »

 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it