poj 2406連続サブストリング
2974 ワード
パワースターリング
Time Limit: 3000 MS
メモリLimit: 65536 K
Total Submissions: 41110
Acceepted: 17099
Description
Given two stinings a and b we define a*b to be their concateation.For example、if="abc"andb="def"the n a*b="abcdef".If wethininininininininininininininininamltipcation、exponentiation=="aaaaatttttttttinininininininininininininininininininininininininininininininininininininininininininininininininininininininininininininininininininininininininininininin)
Input
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 milion characters.A line containing a period follows the last test case.
Output
For each s you shoul d print the larget n such that=a^n for some string a.
Time Limit: 3000 MS
メモリLimit: 65536 K
Total Submissions: 41110
Acceepted: 17099
Description
Given two stinings a and b we define a*b to be their concateation.For example、if="abc"andb="def"the n a*b="abcdef".If wethininininininininininininininininamltipcation、exponentiation=="aaaaatttttttttinininininininininininininininininininininininininininininininininininininininininininininininininininininininininininininininininininininininininininininin)
Input
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 milion characters.A line containing a period follows the last test case.
Output
For each s you shoul d print the larget n such that=a^n for some string a.
/*
poj2406
,
DA
, Rank[0] Rank[k] n-k
( ,0~k = k+1~2*k+1 .... 0~k
)
MLE. RMQ , 。
Rank[0], rank[0]
DA nlog(n) TLE- -
DC3 , 2600ms
kmp ( )
hhh-2016-03-13 18:11:02
*/
#include
#include
#include
#include
#include
#include
#include
#include