Java教程

翻译联系 Day14

本文主要是介绍翻译联系 Day14,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

题目:You're Given a String... | JXNUOJ

翻译:

You're Given a String...

2000ms 262144K

描述:

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).

给你一个含小写字母的字符串,你的任务是找到在这个字符串中出现至少两次的最长字串。这些字串可以重叠(看样例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.

第一行输出一行字符串。保证这个字符串不空,且由小写字母组成,长度不超过100.

输出:

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

输出一个数字——在这个字符串中出现至少两次的字串的最大长度

样例输入:

abcd

样例输出:

0

样例输入:

ababa

样例输出:

3

样例输入:

zzz

样例输出:

2
这篇关于翻译联系 Day14的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!