結果
| 問題 | No.1738 What's in the box? |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-11-12 23:05:56 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 30 ms / 2,000 ms |
| + 395µs | |
| コード長 | 287 bytes |
| 記録 | |
| コンパイル時間 | 52 ms |
| コンパイル使用メモリ | 14,720 KB |
| 実行使用メモリ | 11,776 KB |
| 最終ジャッジ日時 | 2026-10-15 00:15:26 |
| 合計ジャッジ時間 | 5,374 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 72 |
ソースコード
from fractions import Fraction
n, m = map(int, input().split())
W = list(map(int, input().split()))
if m == 0:
print(*[0 for _ in range(n)])
exit()
sumW = sum(W)
w = Fraction(sumW, m)
ans = []
for i in range(n):
ans.append(int(Fraction(W[i], w)))
print(*ans)