PersonalCorpus 版 (精华区)

1241748 Big Guava ... 10038 Accepted
0:00.012 64 2002/11/16 09:07:00.850

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

    int i,j,k,t;
    char c[3000];
    bool ok;

    while (scanf("%d",&t)==1) {
        memset(c,0,t); c[0]=1;
        scanf("%d",&j); ok=true;
        for (i=1;i<t;i++) {
            scanf("%d",&k);
            if (!ok) continue;
            j=abs(j-k);
            if (j>=t) ok=false;
            if (c[j]) ok=false; else c[j]=1;
            j=k;
        }
        if (ok) printf("Jolly\n");
        else printf("Not jolly\n");
    }
}
[百宝箱] [返回首页] [上级目录] [根目录] [返回顶部] [刷新] [返回]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.067毫秒