测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A7838. You're Given a String...

编程题 普及/提高-

题目描述

You're given a string of lower-case Latin letters. Your task is to find the length of its longest substring that can be met in the string at least twice. These occurrences can overlap (see sample test 2).

输入格式

The first input line contains the string. It's guaranteed, that the string is non-empty, consists of lower-case Latin letters, and its length doesn't exceed 100.

输出格式

Output one number — length of the longest substring that can be met in the string at least twice.

输入输出样例

输入 #1
abcd
输出 #1
0
输入 #2
ababa
输出 #2
3
输入 #3
zzz
输出 #3
2
上一题 去做题 下一题