50求助
查看原帖
50求助
1395991
wenyuchixiao楼主2025/1/19 14:40

题目的颜色和我的脸色一样,一点红,然后一坨青和一坨紫

#include<bits/stdc++.h>
using namespace std;
int a[1005], x[1005];
int main() {
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++) cin >> a[i];
	for (int i = 2; i <= n; i++) x[abs(a[i] - a[i - 1])] = 1;
	for (int i = 1; i < n; i++) {
		if (x[i] == 0) {
			cout << "Not Jolly\n";
			return 0;
		}
	}
	cout << "Jolly\n";
	return 0;
}
2025/1/19 14:40
加载中...