1719 - Prefix and Suffix
Time Limit : 5 Second
Memory Limit : 512 MB
Submission: 34
Solved: 5
- Description
give you two integers L<=R, we call a string A "good" if
1.len(A) > R
2.there is a string B is both the prefix and suffix of A
3.L <= len(B) <= R
(len(X) means the length of x)
for a give string S, you should find the length of longest good string in all substring of S
if there is no good string,just output 0
- Input
the first line contains two integers L, R (L<=R<=1e6)
the second line contains the string S (|S|<=1e6)
- Output
output the answer in one line
- sample input
-
Sample Input1 2 3 rssrssr Sample Input2 3 4 rssrssr
- sample output
-
Sample Output 6 Sample Output2 7
- hint
- source
- chenliqi