結果

問題 No.2451 Redistribute Integers
ユーザー Challestend Rehtorbegnaro
提出日時 2023-09-01 21:28:02
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 395 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 32,256 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-11 10:59:08
合計ジャッジ時間 2,021 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 8 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#define maxn 500000

int n;
int a[maxn + 5];

int main()
{
	scanf("%d", &n);
	for (int i = 1; i <= n; ++i)
		scanf("%d", &a[i]);
	bool ans = true;
	if (n == 2)
		ans = (a[1] - a[2]) % 2 == 0;
	else
	{
		for (int i = 1; i <= n; ++i)
			if ((a[i + 1] - a[i]) % (n - 2) != 0)
				ans = false;
	}
	if (ans)
		puts("Yes");
	else
		puts("No");
	return 0;
}
0