当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2406:Power Strings

题目描述
Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concatenation as multiplication, exponentiation by a non-negative integer is defined in the normal way: a^0 = "" (the empty string) and a^(n+1) = a*(a^n).
输入解释
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 n such that s = a^n for some string a.
输入样例
abcd
aaaa
ababab
.
输出样例
1
4
3
提示
This problem has huge input, use scanf instead of cin to avoid time limit exceed.

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-2406

最后修改于 2020-10-29T06:31:45+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
3000 65536