PersonalCorpus 版 (精华区)

1241080 ig Guava ... 305 Accepted
0:01.037 388 2002/11/16 06:25:18.753

1241079 Big Guava ... 305 Accepted
0:00.004 64 2002/11/16 06:25:18.735

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

    int i,j,k,l,t;
//    int c[14]={0,2,7,5,30,169,441,1872,7632,1740,93313,459901,
1358657,2504881};
    int c[14];

    for (k=1;k<14;k++) {
        for (t=1+k;;t++) {
            if ((t-1)%(k+k)<k) t+=k;
            for (i=2;i<=k;i++) {
                l=t-1;
                for (j=k+k-i+1;j<k+k;j++)
                    l=(l%j+t)%(j+1);
                if (l<k) break;
            }
            if (i>k) break;
        }
        c[k]=t;
//        printf("%d,",t);
    }

    while (1) {
        scanf("%d\n",&k);
        if (k==0) break; else printf("%d\n",c[k]);
    }

}
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:3.270毫秒