50分求助
查看原帖
50分求助
742120
w15998366226楼主2022/12/25 08:51
#include<bits/stdc++.h>
using namespace std;
int main(){
	int a[1001]={};
	bool b[1001]={};
	int n=0;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		if(b[a[i]-a[i-1]]){
			cout<<"Not jolly";
			return 0;
		}
	}
	for(auto i:b){
		if(!i){
			cout<<"Not jolly";
			return 0;
		}
	}
	cout<<"Jolly";
	return 0;
}
2022/12/25 08:51
加载中...