50分球dalao
查看原帖
50分球dalao
1328480
AABB1234楼主2024/11/3 08:34

我的 CODE

#include<bits/stdc++.h>
using namespace std;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);//消掉cin的等待时间
	int n;
	cin >> n;
	int a[n + 1], b[n];
	for (int i = 0; i <= n - 1; i++)
		b[i] = 0;
	for (int i = 1; i <= n; i++)
		cin >> a[i];
	for (int i = 1; i <= n - 1; i++) {
		if (abs(a[i] - a[i + 1]) >= n) {
			cout << "Not jolly";
		}
		b[abs(a[i] - a[i + 1])]++;
		if (b[abs(a[i] - a[i + 1])] > 1) {
			cout << "Not jolly";
		}
	}
	cout << "Jolly";
	return 0;
}

我是C语言小佬

好了好了,话归正题( ̄▽ ̄) 

有没有dalao帮助一下

没有关注

玄关

2024/11/3 08:34
加载中...