yesugarisaicharanreddy's blog

By yesugarisaicharanreddy, history, 2 hours ago, In English

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.

»
2 hours ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

You are getting ILE. Fix it by cout << endl; after each queries.

  • »
    »
    93 minutes ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    i tried that too, but i am still getting ILE. the issue seems to be something else.

    • »
      »
      »
      81 minute(s) ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      Can you send me your code, since somehow it's showing N/A for me