結果
| 問題 |
No.2451 Redistribute Integers
|
| コンテスト | |
| ユーザー |
rlangevin
|
| 提出日時 | 2023-09-01 21:25:56 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 269 bytes |
| コンパイル時間 | 225 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 154,380 KB |
| 最終ジャッジ日時 | 2024-06-11 10:58:18 |
| 合計ジャッジ時間 | 3,963 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 WA * 6 |
ソースコード
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")
rlangevin