以文本方式查看主题 - 中文XML论坛 - 专业的XML技术讨论区 (http://bbs.xml.org.cn/index.asp) -- 『 算法理论与分析 』 (http://bbs.xml.org.cn/list.asp?boardid=60) ---- 英语高手进 (http://bbs.xml.org.cn/dispbbs.asp?boardid=60&rootid=&id=44808) |
-- 作者:wangmeigong -- 发布时间:4/3/2007 9:33:00 PM -- 英语高手进 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. For each s you should print the largest n such that s = a^n for some string a. 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. abcd 1 |
-- 作者:wangmeigong -- 发布时间:4/4/2007 6:46:00 PM -- 怎么这么多人就没有一个懂的? |
-- 作者:hgd250 -- 发布时间:1/21/2008 5:17:00 PM -- 定义字符串的乘法(*),即:a*b为a,b两个字符串相连 例如:若a="abc",b="def"则a*b="abcdef" 定义字符串的指数(^)形式:要求指数是非负的,若a为字符串,则a^0="";a^(n+1)=a*(a^n); 输出:字符串S可由某个字符串a的指数形式表示 即:s=a^n
|
W 3 C h i n a ( since 2003 ) 旗 下 站 点 苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》 |
46.875ms |