結果

問題 No.1738 What's in the box?
ユーザー lloyz
提出日時 2021-11-12 23:05:03
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 266 bytes
コンパイル時間 118 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,520 KB
最終ジャッジ日時 2024-11-25 21:11:46
合計ジャッジ時間 3,938 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 68 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

from fractions import Fraction

n, m = map(int, input().split())
W = list(map(int, input().split()))
if m == 0:
    print(0)
    exit()

sumW = sum(W)
w = Fraction(sumW, m)
ans = []
for i in range(n):
    ans.append(int(Fraction(W[i], w)))
print(*ans)
0