getting runtime error in 1081D — Maximum Distance

Revision en2, by priojeet_priyom, 2019-01-03 08:03:49

my approach to this problem is:
1. build mst using prims
2. run a bfs from any special node to find the maximum edge between special nodes and that edge is the answer for all nodes.
my submission

Tags prims, bfs, #graph theory

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English priojeet_priyom 2019-01-03 08:03:49 1
en1 English priojeet_priyom 2019-01-03 08:03:17 369 Initial revision (published)