50pts
查看原帖
50pts
1356720
fuxing1126楼主2024/12/22 10:40
#include <bits/stdc++.h>
using namespace std;
bool bol[100000];
int main(){
    long long n,a[10000]={0};
    cin>>n;
    for(int i=1;i<=n;i++) cin>>a[i];
    for(int i=2;i<=n;i++) bol[abs(a[i]-a[i-1])]=true;
    for(int i=1;i<=n;i++)
        if(bol[i]==false){
            cout<<"Not jolly";
            return 0;
        }
    cout<<"Jolly";
    return 0;
}
2024/12/22 10:40
加载中...