| ||||||||||
| 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<stdio.h>
int main()
{
int n,a,b,i,tag,temp;
while(scanf("%d",&n)==1)
{
if(n==1)
{
scanf("%d",&a);
printf("Jolly\n");
}
else
{
temp=1;
scanf("%d",&a);
for(i=2;i<=n;i++)
{
if(i%2==0)
scanf("%d",&b);
else
scanf("%d",&a);
tag=b>a?(b-a):(a-b);
if(!(tag>=1&&tag<=n-1))
temp=0;
}
if(temp==1)
printf("Jolly\n");
else
printf("Not jolly\n");
}
}
return 0;
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator