Given a character string , we define to be the length of the longest substring of which appears at least times in , or if such a substring does not exist. For example, because of the three occurrences of the substring , and because of the repeated substring . Note that the occurrences can overlap.
Let , and be the sequences defined by:
and the character string . You are given that , , , , , , , and that the sum of non-zero for is .
Find the sum of non-zero for .
给定一个字符串 ,记 为:所有在 中至少重复出现 次的子串中,长度的最大值;若不存在符合要求的子串,函数值为 。例如有 ,因为子串 出现了 3 次;,因为 出现了 7 次。请注意,出现的子串之间允许有公共部分。
记 、 和 为三个 序列,其定义如下:
并记 为 顺序组成的 字符串。已知:、、、、、、;且 时,所有非零的 之和为 。
求 时,所有非零的 之和。
点 这个链接 回到源站。
点 这个链接 回到详细版题目目录。