結果

問題 No.2451 Redistribute Integers
ユーザー L1lykn1ghtL1lykn1ght
提出日時 2023-09-02 12:33:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 222 ms / 2,000 ms
コード長 359 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 87,072 KB
実行使用メモリ 157,092 KB
最終ジャッジ日時 2023-09-02 12:33:16
合計ジャッジ時間 5,311 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
70,944 KB
testcase_01 AC 76 ms
71,416 KB
testcase_02 AC 75 ms
71,268 KB
testcase_03 AC 77 ms
71,304 KB
testcase_04 AC 222 ms
157,092 KB
testcase_05 AC 79 ms
71,236 KB
testcase_06 AC 78 ms
71,128 KB
testcase_07 AC 77 ms
71,072 KB
testcase_08 AC 197 ms
147,440 KB
testcase_09 AC 77 ms
70,948 KB
testcase_10 AC 78 ms
70,948 KB
testcase_11 AC 75 ms
71,300 KB
testcase_12 AC 119 ms
107,112 KB
testcase_13 AC 209 ms
156,408 KB
testcase_14 AC 209 ms
156,692 KB
testcase_15 AC 158 ms
127,108 KB
testcase_16 AC 143 ms
120,932 KB
testcase_17 AC 180 ms
127,608 KB
testcase_18 AC 207 ms
156,352 KB
testcase_19 AC 87 ms
81,636 KB
testcase_20 AC 200 ms
132,384 KB
testcase_21 AC 220 ms
155,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines


N, *A = map(int, read().split())

sm = sum(A)
if sm % N:
    print('No')
    sys.exit()

num = sm // N
c1 = 0
c2 = 0
for i in range(1, N):
    if abs(A[i] - A[i - 1]) % N == 0:
        continue
    else:
        print('No')
        break
else:
    print('Yes')
0