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 KatrineYang at 2016-11-06 13:54:16 on Problem 2575
#include <stdio.h>
int main() {
	int n;
	while(scanf("%d",&n)>0){
		bool h[3333]={0};
		int t;
		bool k=1;
		for(int i=0;i<n;i++){
			int T;
			scanf("%d",&T);
			if(!k)continue;
			if(i){
				int c=((T-t)>>31)?t-T:T-t;
				if(!c||c>=n||h[c])k=0;
				else h[c]=1;
			}
			t=T;
		}
		printf(k?"Jolly\n":"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