You are given a tree which has n nodes, the root’s id is 1 and each node has an lowercase latter.
It is clear that we can get n roads from the root, each road forms a road string. Please calculate the number of different substrings in each road string.
3 3 1 2 2 3 abc 3 1 2 2 3 aaa 3 1 2 2 3 aab
1 3 6 1 2 3 1 2 5
无
本站或者转载