Long substring with many repetitions
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:
- (where is the golden ratio)
and the character string . You are given that , , , , , , , and that the sum of non-zero for is .
Find the sum of non-zero for .
多次重复的长子串
给定字符串,记为在中至少重复出现次的子串中最长子串的长度,如果这样的子串不存在则取。例如,,因为子串重复出现了三次;而因为子串重复出现了两次。注意子串的多次出现之间允许重复使用字符。
记、和为由如下规则生成的序列:
记为字符串。已知,,,,,,,而对于任意,所有非零的之和为。
对于任意,求所有非零的之和。
Gitalking ...