#P8617. [蓝桥杯 2014 国 AC] 重复模式
[蓝桥杯 2014 国 AC] 重复模式
Description
As drd’s good friend, the tech guy atm gave him a very long string as a birthday present. atm asks drd to find a longest string such that appears in at least twice, and the secret he wants to tell is hidden in .
Because the string is too long, drd can never find a suitable . So drd asks you to help find the length of this .
Input Format
One line. A string, which is mentioned in the statement.
Output Format
One line. An integer, representing the length of the longest .
ababa
3
Hint
For of the testdata, the length of is .
For of the testdata, the length of is .
For of the testdata, the length of is .
Time limit: 1 second, 256M. Lanqiao Cup 2014, the 5th National Final.
Translated by ChatGPT 5
京公网安备 11011102002149号