Help me in my approach. problem — 2258c

Revision en1, by yesugarisaicharanreddy, 2026-10-16 16:42:07

Can someone help me with this problem — https://codeforces.me/problemset/problem/2258/C

i used 2 bfs traversals to find the tree's diameter, i built an adjacency list from the tree edges, used bfs from node 1 to find the farthest node, then ran bfs again from that node to find the diameter and printed the endpoints and distance.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English yesugarisaicharanreddy 2026-10-16 16:42:07 379 Initial revision (published)