#include <cstdio>
#include <cmath>
#include <cstring>
using namespace std;
int array[3001];
int count[3000];
int main()
{
int n;
while (scanf("%d", &n) != EOF)
{
memset(count, 0, sizeof(count));
for (int i = 0; i < n; i++)
{
scanf("%d", &array[i]);
}
int flag = 0;
for (int i = 1; i < n; i++)
{
int temp = (int)(fabs(array[i] - array[i - 1]));
if (temp > 0 && temp < n)
count[temp]++;
else
{
flag = 1;
break;
}
}
if (flag)
printf("Not jolly/n");
else
{
for (int i = 1; i < n; i++)
{
if (count[i] != 1)
{
flag = 1;
break;
}
}
if (flag)
printf("Not jolly/n");
else
printf("Jolly/n");
}
}
return 0;
}
uva10038 Jolly Jumpers
最新推荐文章于 2019-07-31 10:04:20 发布