题解 P1152 【欢乐的跳】

· · 题解

这题真水(hǎo) 不错的题

花了8min做的

各位dalao喷 qwq

各位dalao勿喷

不废话 代码,出现吧!

using namespace std;
int n[100001];
int m,temp,a=0;
int main(){
cin>>m;
cin>>n[0]; //为了防止数组越界,先提前输入第一个数
for(int i=1;i<m;i++){
cin>>n[i];
temp=abs(n[i-1]-n[i]);
for(int j=1;j<m;j++){
if(temp==j) a++;
}
}
if(a==m-1) cout<<"Jolly";
else cout<<"Not jolly";
return 0;//这是好习惯
}