結果

問題 No.662 スロットマシーン
ユーザー kohei2019
提出日時 2022-03-07 23:31:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 110 ms / 2,000 ms
コード長 453 bytes
コンパイル時間 318 ms
コンパイル使用メモリ 82,144 KB
実行使用メモリ 77,184 KB
最終ジャッジ日時 2024-07-22 20:35:14
合計ジャッジ時間 2,511 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
dics = dict()
keys = []
for i in range(5):
    s,c = input().split()
    dics[s] = int(c)
    keys.append(s)
alln = 1
cnt = []
for i in range(3):
    n = int(input())
    alln *= n
    ls = [input() for i in range(n)]
    cnt.append(collections.Counter(ls))

ans = []
val = 0
for key in keys:
    v = cnt[0][key]*cnt[1][key]*cnt[2][key]*5
    ans.append(v)
    val += v*dics[key]

print(val/alln)
for i in range(5):
    print(ans[i])
0