結果

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

ソースコード

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;
	for (int i = 1; i < n; ++i)
		if ((a[i + 1] - a[i]) % n != 0)
			ans = false;
	if (ans)
		puts("Yes");
	else
		puts("No");
	return 0;
}
0