Spoj after the revision is very embarrassing ...
Number of different substrings (spoj694,spoj705)
Given a string, the number of substrings is not the same.
Algorithm Analysis:
Each substring must be a prefix of a suffix, so the original problem is equivalent to asking for a non-phase between all suffixes
The number of prefixes with the same. If all suffixes follow suffix (sa[1]), suffix (sa[2]),
Suffix (sa[3]), ..., suffix (sa[n]), not difficult to find, for each new addition
In the suffix suffix (sa[k]), it will generate n-sa[k]+1 a new prefix. But there are
HEIGHT[K] is the same as the prefix of the preceding string. So suffix (sa[k]) will "contribute"
Out N-sa[k]+1-height[k] a different substring. The answer to the original question is the summation. This approach
The time complexity is O (n).
Number of strings with "suffix array" not identical