PersonalCorpus 版 (精华区)

1245739 Big Guava ... 10298 Accepted
0:01.523 1372 2002/11/18 06:33:28.947

void main()
{
#ifndef ONLINE_JUDGE
    freopen("k:\\uva\\i10298","r",stdin);
    freopen("k:\\uva\\o10298","w",stdout);
#endif

    int i,j,k,t;
    char s[1000010];

    while (1) {
        gets(s);
        if (strcmp(s,".")==0) break;
        t=strlen(s);
        for (i=1;s[i];i++) if (t%i==0) {
            for (j=1;j<t/i;j++) if (memcmp(s,s+j*i,i)!=0) break;
            if (j==t/i) break;
        }
        printf("%d\n",t/i);
    }
}
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:5.042毫秒