結果

問題 No.2451 Redistribute Integers
ユーザー Challestend RehtorbegnaroChallestend Rehtorbegnaro
提出日時 2023-09-01 21:29:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 77 ms / 2,000 ms
コード長 323 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 31,372 KB
実行使用メモリ 4,992 KB
最終ジャッジ日時 2023-09-01 21:29:10
合計ジャッジ時間 2,209 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 77 ms
4,904 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 57 ms
4,856 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 25 ms
4,376 KB
testcase_13 AC 68 ms
4,932 KB
testcase_14 AC 68 ms
4,992 KB
testcase_15 AC 36 ms
4,380 KB
testcase_16 AC 33 ms
4,380 KB
testcase_17 AC 53 ms
4,376 KB
testcase_18 AC 67 ms
4,796 KB
testcase_19 AC 6 ms
4,376 KB
testcase_20 AC 56 ms
4,380 KB
testcase_21 AC 69 ms
4,808 KB
権限があれば一括ダウンロードができます

ソースコード

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