結果

問題 No.662 スロットマシーン
ユーザー 💕💖💞💕💖💞
提出日時 2018-11-22 22:29:12
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 571 bytes
コンパイル時間 482 ms
コンパイル使用メモリ 10,980 KB
実行使用メモリ 8,700 KB
最終ジャッジ日時 2023-08-26 04:05:29
合計ジャッジ時間 1,900 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,456 KB
testcase_01 AC 16 ms
8,504 KB
testcase_02 AC 16 ms
8,564 KB
testcase_03 AC 16 ms
8,508 KB
testcase_04 AC 18 ms
8,584 KB
testcase_05 AC 16 ms
8,496 KB
testcase_06 AC 20 ms
8,560 KB
testcase_07 AC 20 ms
8,576 KB
testcase_08 AC 27 ms
8,664 KB
testcase_09 AC 35 ms
8,640 KB
testcase_10 AC 38 ms
8,592 KB
testcase_11 AC 35 ms
8,640 KB
testcase_12 AC 34 ms
8,532 KB
testcase_13 AC 36 ms
8,576 KB
testcase_14 AC 35 ms
8,700 KB
testcase_15 AC 34 ms
8,620 KB
testcase_16 AC 15 ms
8,492 KB
testcase_17 AC 35 ms
8,672 KB
testcase_18 AC 35 ms
8,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
char_score = {}
chars = []
for i in range(5):
  char, score = input().split()
  char_score[char] = int(score)
  chars.append(char)
#print(char_score)
char_freq = {char:5 for char,score in char_score.items()}
Ns = []
for i in range(3):
  N = int(input())
  Ns.append(N)
  o = dict(Counter([input() for n in range(N)]))
  for char in chars:
    char_freq[char] *= o[char] if o.get(char) else 0
  
points = sum([char_freq[char]*char_score[char] for char in chars])
print(points/(Ns[0]*Ns[1]*Ns[2]))
for char in chars:
  print(char_freq[char])
0