社区讨论

大领袖们帮帮忙

P1152欢乐的跳参与者 2已保存回复 1

讨论操作

快速查看讨论及其快照的属性,并进行相关操作。

当前回复
1 条
当前快照
1 份
快照标识符
@mi6tgaol
此快照首次捕获于
2025/11/20 10:32
4 个月前
此快照最后确认于
2025/11/20 10:32
4 个月前
查看原帖
CPP
#include <iostream>
#include <cstdio>
#define abs(i) (i>0)?i:(-i)
using namespace std;

const int MAX=1001;
int N,tong[MAX],T,P;

int main()
{
	scanf("%d",&N);
	for (int i=1; i<N; i++)
	{
		scanf("%d",&T);
		tong[abs(T-P)]=1;
		P=T;
	}
	for (int i=1; i<N; i++)
		if (!tong[i])
		{
			printf("Not jolly");
			return 0;
		}
	printf("Jolly");
	return 0;
}

回复

1 条回复,欢迎继续交流。

正在加载回复...