結果

問題 No.662 スロットマシーン
ユーザー lloyzlloyz
提出日時 2022-07-23 01:11:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 530 bytes
コンパイル時間 68 ms
コンパイル使用メモリ 10,784 KB
実行使用メモリ 7,920 KB
最終ジャッジ日時 2023-09-17 14:58:54
合計ジャッジ時間 1,640 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,760 KB
testcase_01 AC 16 ms
7,708 KB
testcase_02 AC 17 ms
7,720 KB
testcase_03 AC 18 ms
7,772 KB
testcase_04 AC 21 ms
7,780 KB
testcase_05 AC 17 ms
7,892 KB
testcase_06 AC 23 ms
7,772 KB
testcase_07 AC 23 ms
7,724 KB
testcase_08 AC 41 ms
7,776 KB
testcase_09 AC 55 ms
7,712 KB
testcase_10 AC 53 ms
7,772 KB
testcase_11 AC 54 ms
7,748 KB
testcase_12 AC 55 ms
7,920 KB
testcase_13 AC 55 ms
7,776 KB
testcase_14 AC 54 ms
7,920 KB
testcase_15 AC 54 ms
7,752 KB
testcase_16 AC 16 ms
7,756 KB
testcase_17 AC 53 ms
7,856 KB
testcase_18 AC 54 ms
7,888 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