P1152 欢乐的跳 题解
题意简述
一个
思路
因为
代码实现
最后上代码
#include <bits/stdc++.h>
#define int long long
using namespace std;
int n, a[1010];
bool b[1010];
signed main() {
cin >> n;
for(int i = 1; i <= n; i++)
cin >> a[i];
for(int i = 2; i <= n; i++)
if(a[i] - a[i - 1] < n)
b[abs(a[i] - a[i - 1])] = true;
for(int i = 1; i < n; i++){
if(!b[i]){
puts("Not jolly");
return 0;
}
}
puts("Jolly");
return 0;
}
又及:跳到一篇没有题解的红题,果断写下本蒟蒻的第一篇题解,希望管理员能通过QAQ