結果

問題 No.662 スロットマシーン
ユーザー 👑 rin204rin204
提出日時 2022-01-19 20:55:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 105 ms / 2,000 ms
コード長 467 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 76,672 KB
最終ジャッジ日時 2024-05-02 19:57:46
合計ジャッジ時間 2,547 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
52,480 KB
testcase_01 AC 41 ms
51,712 KB
testcase_02 AC 45 ms
52,864 KB
testcase_03 AC 51 ms
54,528 KB
testcase_04 AC 68 ms
66,560 KB
testcase_05 AC 46 ms
52,736 KB
testcase_06 AC 69 ms
67,200 KB
testcase_07 AC 72 ms
66,688 KB
testcase_08 AC 96 ms
76,416 KB
testcase_09 AC 99 ms
76,544 KB
testcase_10 AC 98 ms
76,288 KB
testcase_11 AC 97 ms
76,288 KB
testcase_12 AC 105 ms
76,544 KB
testcase_13 AC 102 ms
76,672 KB
testcase_14 AC 99 ms
76,544 KB
testcase_15 AC 99 ms
76,416 KB
testcase_16 AC 41 ms
51,840 KB
testcase_17 AC 98 ms
76,416 KB
testcase_18 AC 101 ms
76,416 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