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

Re:日了 Output Limit Exceeded了 加个EOF就好使了

Posted by guangdianytm at 2015-03-26 23:59:10 on Problem 2575
In Reply To:日了 Output Limit Exceeded了 加个EOF就好使了 Posted by:CJQ2011 at 2012-08-09 11:10:06
> 哥们看下我的行吗
#include<stdio.h>
#include<math.h>
#include<string.h>
int main()
{  
	int i;
	int n[3000];
	int groups,before,next,temp,flag;
    while(1)
   {   
          scanf("%d",&groups);
		  if(groups==0||groups==EOF)
			  break;
	  memset(n, 0, sizeof(n));
		  flag=1;
		    scanf("%d",&before);
		  for(i=1;i<groups;i++)
		  {
		      scanf("%d",&next);
			  temp=abs(next-before);
			  n[temp]++;
			  before=next;
		  }
	    for(i=1;i<groups;i++)
		{
		      if(n[i]==0)
			  {
				  flag=0;
			     break;
			  }
		}
		if(flag==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