#1116. 树的直径
树的直径
No submission language available for this problem.
Background
Special for beginners, ^_^
Description
给出一个 个节点的树,求树的直径。
Note:树的直径定义为树中最远的两个节点之间的距离。
Format
Input
输入第一行为一个整数 ,表示树的节点个数。 接下来 行,每行输入两个整数 ,表示 和 之间有边相连。
Output
输出 个数,表示树的直径。
Samples
5
1 2
1 3
4 2
2 5
3
Limitation
1s, 1024KiB for each test case.
Related
In following contests: