经典指数          
POJ
原因
1172
浏览数
0
收藏数
 

The repetition number of a string is defined as the maximum number R such that the string can be partitioned into R same consecutive substrings. For example, the repetition number of "ababab" is 3 and "ababa" is 1. Given a string containing lowercase letters, you are to find a substring of it with maximum repetition number. 输入描述 The input consists of multiple test cases. Each test case contains exactly one line, whichgives a non-empty string consisting of lowercase letters. The length of the string will not be greater than 100,000. The last test case is followed by a line containing a '#'. 输出描述 For each test case, print a line containing the test case number( beginning with 1) followed by the substring of maximum repetition number. If there are multiple substrings of maximum repetition number, print the lexicographically smallest one. 输入例子 ccabababc daabbccaa # 输出例子 Case 1: ababab Case 2: aa

     举报   纠错  
 
切换
暂时还没有答案,欢迎分享你的解答 . . .
撰写答案
扫描后移动端查看本题