#include <iostream>
#include <set>
#include <stdio.h>
using namespace std;
int mm[3000];
int main(){
int n;
while(cin >> n){
memset(mm,0,sizeof(mm));
int last,current;
cin >> last;
for(int i=1 ; i < n; ++i){
cin >> current;
int tmp = abs(current - last);
mm[tmp] = 1;
last = current;
}
int i = 1;
for(; i <n ; ++i){
if(mm[i] == 0) {
break;
}
}
if(i == n)
cout << "Jolly" << endl;
else
cout << "Not jolly" << endl;
}
return 1;
}
POJ2575 Jolly Jumpers
最新推荐文章于 2016-01-29 23:51:42 发布