| ||||||||||
| 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;
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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator