結果

問題 No.662 スロットマシーン
ユーザー maspymaspy
提出日時 2020-02-02 00:30:27
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 593 bytes
コンパイル時間 116 ms
コンパイル使用メモリ 11,924 KB
実行使用メモリ 10,116 KB
最終ジャッジ日時 2023-10-19 00:28:05
合計ジャッジ時間 1,892 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,116 KB
testcase_01 AC 30 ms
10,116 KB
testcase_02 AC 30 ms
10,116 KB
testcase_03 AC 30 ms
10,116 KB
testcase_04 AC 30 ms
10,116 KB
testcase_05 AC 30 ms
10,116 KB
testcase_06 AC 30 ms
10,116 KB
testcase_07 AC 30 ms
10,116 KB
testcase_08 AC 32 ms
10,116 KB
testcase_09 AC 32 ms
10,116 KB
testcase_10 AC 33 ms
10,116 KB
testcase_11 AC 33 ms
10,116 KB
testcase_12 AC 33 ms
10,116 KB
testcase_13 AC 33 ms
10,116 KB
testcase_14 AC 34 ms
10,116 KB
testcase_15 AC 34 ms
10,116 KB
testcase_16 AC 30 ms
10,116 KB
testcase_17 AC 32 ms
10,116 KB
testcase_18 AC 34 ms
10,116 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

from collections import Counter

kinds = []
coins = []
for _ in range(5):
    k,c = readline().split()
    kinds.append(k)
    coins.append(int(c))

counter = []
total = 1
for _ in range(3):
    N = int(readline())
    total *= N
    counter.append(Counter(readline().rstrip() for _ in range(N)))

answer = [5 * counter[0][k] * counter[1][k] * counter[2][k] for k in kinds]

expected = sum(x * y for x,y in zip(answer, coins)) / total

print(expected)
print(*answer, sep='\n')
0