#D7201. Similarity of Subtrees
Similarity of Subtrees
Similarity of Subtrees
Example
Input
5 1 2 1 3 1 4 1 5
Output
6
inputFormat
Input
5 1 2 1 3 1 4 1 5
outputFormat
Output
6
样例
5
1 2
1 3
1 4
1 5
6
Example
Input
5 1 2 1 3 1 4 1 5
Output
6
Input
5 1 2 1 3 1 4 1 5
Output
6
5
1 2
1 3
1 4
1 5
6
By signing up a OpenJudge universal account, you can submit code and join discussions in all online judging services provided by us.