結果

問題 No.662 スロットマシーン
ユーザー 👑 horiesinitihoriesiniti
提出日時 2018-01-18 07:17:19
言語 Ruby
(3.3.0)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 384 bytes
コンパイル時間 58 ms
コンパイル使用メモリ 11,480 KB
実行使用メモリ 15,456 KB
最終ジャッジ日時 2023-08-25 23:11:07
合計ジャッジ時間 2,743 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 84 ms
15,244 KB
testcase_01 AC 82 ms
15,256 KB
testcase_02 AC 81 ms
15,340 KB
testcase_03 AC 84 ms
15,084 KB
testcase_04 AC 83 ms
15,016 KB
testcase_05 AC 83 ms
15,080 KB
testcase_06 AC 84 ms
15,312 KB
testcase_07 AC 84 ms
15,160 KB
testcase_08 AC 88 ms
15,264 KB
testcase_09 AC 91 ms
15,248 KB
testcase_10 AC 91 ms
15,436 KB
testcase_11 AC 90 ms
15,424 KB
testcase_12 AC 90 ms
15,432 KB
testcase_13 AC 90 ms
15,248 KB
testcase_14 AC 91 ms
15,240 KB
testcase_15 AC 93 ms
15,420 KB
testcase_16 AC 81 ms
15,056 KB
testcase_17 AC 93 ms
15,456 KB
testcase_18 AC 92 ms
15,208 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

hs={}
arr=[]
5.times{
	a,b=gets.split
	hs[a]=b.to_i
	arr<<a
}

ls1=Hash.new(0)
ls2=Hash.new(0)
ls3=Hash.new(0)
n1=gets.to_i
n1.times{
	ls1[gets.chomp]+=1
}
n2=gets.to_i
n2.times{
	ls2[gets.chomp]+=1
}
n3=gets.to_i
n3.times{
	ls3[gets.chomp]+=1
}

ansA=0
hs.each{|k,v|
	ansA+=v*ls1[k]*ls2[k]*ls3[k]*5
}
puts ansA*1.0/(n1*n2*n3)
5.times{|i|
	puts ls1[arr[i]]*ls2[arr[i]]*ls3[arr[i]]*5
}
0