#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int main() {
int a_len;
bool key = true;
cin >> a_len;
int a[a_len] = {}, b[a_len - 1] = {};
for (int i = 0; i <= a_len - 1; i++) {
cin >> a[i];
}
for (int i = 0; i <= a_len - 2; i++) {
b[i] = abs(a[i] - a[i + 1]);
}
sort(b, b + a_len - 1);
for (int i = 0; i <= a_len - 1; i++) {
if (a[i] != i + 1) {
key = false;
break;
}
}
if (key) {
cout << "Jolly";
}
else{
cout << "Not jolly";
}
}
它只输出不符合的答案
不知道哪里错了惹/kk