#P2477. Power Strings
Power Strings
题目来源
POJ 2406
题目描述
Given two strings a and b we define to be their concatenation. For example, if and then . If we think of concatenation as multiplication, exponentiation by a non-negative integer is defined in the normal way: (the empty string) and .
输入格式
Each test case is a line of input representing s, a string of printable characters. The length of s will be at least 1 and will not exceed 1 million characters. A line containing a period follows the last test case.
输出格式
For each s you should print the largest such that for some string .
样例
abcd
aaaa
ababab
1
4
3
提示
This problem has huge input, use scanf instead of cin to avoid time limit exceed.
相关
在以下作业中: