POJ3693Maximum repetition substring (后缀数组+RMQ)(占位)

Posted ---学习ing---

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了POJ3693Maximum repetition substring (后缀数组+RMQ)(占位)相关的知识,希望对你有一定的参考价值。

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.

Input

The input consists of multiple test cases. Each test case contains exactly one line, which
gives 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 ‘#‘.

Output

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.

Sample Input

ccabababc
daabbccaa
#

Sample Output

Case 1: ababab
Case 2: aa

 

先占位,再慢慢想,ORZ。

 

以上是关于POJ3693Maximum repetition substring (后缀数组+RMQ)(占位)的主要内容,如果未能解决你的问题,请参考以下文章

POJ3693Maximum repetition substring (后缀数组+RMQ)(占位)

POJ3693 Maximum repetition substring

POJ 3693 Maximum repetition substring(最多重复次数的子串)

POJ 3693 Maximum repetition substring(后缀数组+RMQ)

POJ 3693 Maximum repetition substring ——后缀数组

POJ 3693 Maximum repetition substring(后缀数组[重复次数最多的连续重复子串])