POJ - 2631 - Roads in the North(树的直径模板+知识讲解)
Source::Click here
Sample Input
5 1 6
1 4 5
6 3 9
2 6 8
6 1 7
Sample Output
22
这篇博客的证明讲解听清楚的,值得收藏!Click here
求树的直径的方法
题解
下面的模板代码中用到了pair,之前没用过,第一次见,觉得用来存权值比较方便。通过别人的博客再了解一下(Click here)。
...
原创
2018-08-05 10:29:37 ·
188 阅读 ·
0 评论