跳到正文

题解

题解 P1152 【欢乐的跳】

NefeliOwO约 1 分钟
原文
文章信息与版本

文章信息

发布
2019年7月8日
收录
2026年8月12日
更新
2026年11月17日
篇幅
约 1 分钟
题目
P1152

版本

  1. v1当前

这题真水(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;//这是好习惯
}

原文
存档评论1 条抓取于