This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
#include<bits/stdc++.h>
using namespace std;
const int N = 1010;
int a[N], c[N];
int main() {
int n;
scanf("%d", &n);
for (int i = 1; i <= n; i++) scanf("%d", &a[i]);//读入
for (int i = 1; i < n; i++) c[i] = abs(a[i] - a[i + 1]);//处理差
//按差值由小到大排序
sort(c + 1, c + n);
//检查一下缺少哪个数字,缺少的条件是c[i]==i
for (int i = 1; i < n; i++) {
if (c[i] != i) {
printf("Not jolly");
return 0;
}
printf("Jolly");