結果

問題 No.1738 What's in the box?
ユーザー とりゐとりゐ
提出日時 2021-10-14 23:33:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 260 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 82,312 KB
実行使用メモリ 60,736 KB
最終ジャッジ日時 2024-11-25 10:56:25
合計ジャッジ時間 4,584 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 70
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
w=list(map(int,input().split()))
if 1<=n<=10**3 and 0<=m<=10**9 and min(w)>=0 and max(w)<=10**9:
  pass
else:
  raise Exception
if m==0:
  print(*[0]*n)
  exit()

sm_w=sum(w)
ans=[]
for i in w:
  ans.append((i*m)//sm_w)
print(*ans)
0