Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

晕,总是过不了。。

Posted by zhaohongde at 2007-01-27 12:41:44 on Problem 2575
# 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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator