0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-09 01:38:48 +00:00
OI-codes/Luogu/P1152/P1152.cpp

26 lines
450 B
C++
Raw Normal View History

2020-09-24 11:17:57 +00:00
// R38820772
2021-11-19 09:01:13 +00:00
#include <bits/stdc++.h>
2020-09-24 11:17:57 +00:00
using namespace std;
bool cnt[10000005];
int n, a[1005];
int main() {
cin >> n;
2021-11-19 09:01:13 +00:00
for (int i = 0; i < n; i++) {
cin >> a[i];
2020-09-24 11:17:57 +00:00
}
2021-11-19 09:01:13 +00:00
for (int i = 1; i < n; i++) {
if (!cnt[abs(a[i] - a[i - 1])]) {
cnt[abs(a[i] - a[i - 1])] = true;
2020-09-24 11:17:57 +00:00
} else {
cout << "Not jolly" << endl;
return 0;
}
}
cout << "Jolly" << endl;
return 0;
}