結果

問題 No.662 スロットマシーン
ユーザー cympfhcympfh
提出日時 2018-03-12 15:21:46
言語 Ruby
(3.3.0)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 268 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 13,056 KB
最終ジャッジ日時 2024-04-25 10:47:45
合計ジャッジ時間 3,054 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
12,160 KB
testcase_01 AC 93 ms
12,160 KB
testcase_02 AC 91 ms
12,160 KB
testcase_03 AC 94 ms
12,288 KB
testcase_04 AC 99 ms
12,288 KB
testcase_05 AC 92 ms
12,160 KB
testcase_06 AC 99 ms
12,288 KB
testcase_07 AC 102 ms
12,416 KB
testcase_08 AC 104 ms
12,672 KB
testcase_09 AC 113 ms
13,056 KB
testcase_10 AC 114 ms
12,928 KB
testcase_11 AC 109 ms
12,672 KB
testcase_12 AC 114 ms
12,928 KB
testcase_13 AC 109 ms
12,928 KB
testcase_14 AC 112 ms
12,800 KB
testcase_15 AC 116 ms
12,800 KB
testcase_16 AC 92 ms
12,288 KB
testcase_17 AC 113 ms
12,672 KB
testcase_18 AC 112 ms
12,928 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

memo={}
5.times{
  s,c=gets.split
  memo[s]=c.to_i
}
a=3.times.map{|i|
  n=gets.to_i
  n.times.map{gets.chomp}
}
cx={}
sum=0.0
memo.keys.map{|s|
  cx[s]=5*a.map{|b|b.count s}.inject(:*)
  sum+=cx[s]*memo[s]
}

p sum / a.map(&:size).inject(:*)
memo.keys.map{|s|p cx[s]}
0