my submission:
http://mirror.codeforces.com/contest/472/submission/15130187
is getting TLE on test 10.I have founded the minimum spanning tree and then calculated the distance between each pair of nodes using BFS.
GETTING TLE IN 472D ( FOLLOWING EDITORIAL)
my submission:
http://mirror.codeforces.com/contest/472/submission/15130187
is getting TLE on test 10.I have founded the minimum spanning tree and then calculated the distance between each pair of nodes using BFS.