結果

問題 No.662 スロットマシーン
ユーザー lloyzlloyz
提出日時 2022-07-23 01:11:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 115 ms / 2,000 ms
コード長 530 bytes
コンパイル時間 611 ms
コンパイル使用メモリ 87,008 KB
実行使用メモリ 77,440 KB
最終ジャッジ日時 2023-09-17 14:58:51
合計ジャッジ時間 3,978 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
71,040 KB
testcase_01 AC 78 ms
71,224 KB
testcase_02 AC 87 ms
76,424 KB
testcase_03 AC 90 ms
76,876 KB
testcase_04 AC 106 ms
76,724 KB
testcase_05 AC 88 ms
76,612 KB
testcase_06 AC 103 ms
76,572 KB
testcase_07 AC 105 ms
76,720 KB
testcase_08 AC 109 ms
77,400 KB
testcase_09 AC 110 ms
77,420 KB
testcase_10 AC 110 ms
77,364 KB
testcase_11 AC 110 ms
77,236 KB
testcase_12 AC 113 ms
77,416 KB
testcase_13 AC 114 ms
77,440 KB
testcase_14 AC 113 ms
77,256 KB
testcase_15 AC 115 ms
77,180 KB
testcase_16 AC 78 ms
71,344 KB
testcase_17 AC 111 ms
77,332 KB
testcase_18 AC 113 ms
77,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

L = []
for _ in range(5):
    l, c = input().split()
    L.append((l, int(c)))

C = []
tot = 1
for _ in range(3):
    n = int(input())
    tot *= n
    CC = [0, 0, 0, 0, 0]
    for __ in range(n):
        l = input()
        for i in range(5):
            if L[i][0] == l:
                CC[i] += 1
    C.append(CC)

ans = 0.0
ANS = [0, 0, 0, 0, 0]
for i in range(5):
    res = 5
    for j in range(3):
        res *= C[j][i]
    ANS[i] = res
for i in range(5):
    ans += ANS[i] * L[i][1] / tot
print(ans)
print(*ANS, sep='\n')
0