結果

問題 No.662 スロットマシーン
ユーザー 👑 rin204rin204
提出日時 2022-01-19 20:55:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 467 bytes
コンパイル時間 1,936 ms
コンパイル使用メモリ 86,940 KB
実行使用メモリ 77,720 KB
最終ジャッジ日時 2023-08-15 08:09:08
合計ジャッジ時間 3,968 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,264 KB
testcase_01 AC 72 ms
71,412 KB
testcase_02 AC 76 ms
71,556 KB
testcase_03 AC 80 ms
71,072 KB
testcase_04 AC 94 ms
76,540 KB
testcase_05 AC 75 ms
71,248 KB
testcase_06 AC 93 ms
76,532 KB
testcase_07 AC 93 ms
76,616 KB
testcase_08 AC 115 ms
77,428 KB
testcase_09 AC 116 ms
77,720 KB
testcase_10 AC 116 ms
77,384 KB
testcase_11 AC 116 ms
77,352 KB
testcase_12 AC 116 ms
77,600 KB
testcase_13 AC 114 ms
77,564 KB
testcase_14 AC 114 ms
77,300 KB
testcase_15 AC 115 ms
77,352 KB
testcase_16 AC 72 ms
71,356 KB
testcase_17 AC 116 ms
77,300 KB
testcase_18 AC 116 ms
77,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

dic = {}
for _ in range(5):
    s, c = input().split()
    dic[s] = int(c)

cnt = [{} for _ in range(3)]
div = 1
for i in range(3):
    n = int(input())
    div *= n
    for _ in range(n):
        a = input()
        cnt[i][a] = cnt[i].get(a, 0) + 1
        
tot = 0
ans = [0] * 5
for i, (s, c) in enumerate(dic.items()):
    prod = 5
    for j in range(3):
        prod *= cnt[j].get(s, 0)
    tot += c * prod
    ans[i] = prod
print(tot / div)
print(*ans, sep="\n")
0