Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
直接暴力#include<cstdio> #include<cstring> char str[1000000]; int main() { while(scanf("%s",str),str[0]!='.') { int i,j=0; int len = strlen(str); for(i=1;j!=len && i<len;i++) if(len%i == 0) for(j=i;j<len && strncmp(str,str+j,i)==0;j+=i); printf("%d\n",i==len? 1:len/(i-1)); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator