帮帮我
查看原帖
帮帮我
1384803
yangshiqi666楼主2024/7/4 19:08
#include<bits/stdc++.h>
using namespace std;
long long a[1000];
int main(){
	int i,n,x,y;
	cin>>n>>x;
	for(i=2;i<=n;i++){
		cin>>y;
		if(y>x){
			a[y-x]=1;
		}else{
			a[x-y]=1; 
		}
		x=y;
	}
	for(i=1;i<n;i++){
		if(a[i]!=1){
			cout<<"Not jolly";
			return 0; 
		}
	}
	cout<<"Jolly";
	return 0;
	cout<<fixed<<setprecision(2)<<a[n];
	return 0;
}
2024/7/4 19:08
加载中...