結果

問題 No.2451 Redistribute Integers
ユーザー rlangevinrlangevin
提出日時 2023-09-01 21:25:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 269 bytes
コンパイル時間 331 ms
コンパイル使用メモリ 86,920 KB
実行使用メモリ 174,048 KB
最終ジャッジ日時 2023-09-01 21:26:05
合計ジャッジ時間 4,549 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
70,952 KB
testcase_01 AC 69 ms
71,092 KB
testcase_02 AC 72 ms
71,160 KB
testcase_03 AC 71 ms
71,296 KB
testcase_04 AC 199 ms
154,616 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 71 ms
71,008 KB
testcase_08 AC 168 ms
148,928 KB
testcase_09 AC 72 ms
70,848 KB
testcase_10 AC 72 ms
71,076 KB
testcase_11 AC 72 ms
71,036 KB
testcase_12 WA -
testcase_13 AC 204 ms
174,048 KB
testcase_14 AC 204 ms
154,152 KB
testcase_15 AC 140 ms
111,144 KB
testcase_16 AC 135 ms
104,912 KB
testcase_17 WA -
testcase_18 AC 188 ms
141,644 KB
testcase_19 WA -
testcase_20 AC 163 ms
136,544 KB
testcase_21 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
p, m = 0, 0
S = sum(A)
if S % N != 0:
    print("No")
    exit()
    
S //= N
for a in A:
    if a <= S:
        p += S - a
    else:
        d = a - S
        m += d 
        
print("Yes") if p == m else print("No")
0