2WA
3 7 9 10 都RE
代码:
#include <bits/stdc++.h>
using namespace std;
int n,a[1005],vs[200000005];
bool book[1005];
int main(){
cin >> n;
for(int i = 1; i <= n; i++)
cin >> a[i];
for(int i = 1; i < n; i++){
vs[i] = abs(a[i]-a[i+1]);
}
for(int i = 1; i < n; i++){
book[vs[i]] = true;
}
for(int i = 1; i < n; i++){
if(!book[i]){
cout << "Not jolly" << endl;
}
}
cout << "Jolly" << endl;
return 0;
}