|
|
back to boardA got AC,but my algo is O(N^3). I know algo O(N*N*logN). Idea is Dijkstra (N times from every node). I can proof that minimal cycle turns when we add one edge in root tree (tree of distance). Edited by author 06.09.2015 15:53 Edited by author 06.09.2015 15:54 |
|
|