結果

問題 No.662 スロットマシーン
ユーザー cielciel
提出日時 2018-01-31 20:58:27
言語 Ruby
(3.3.0)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 435 bytes
コンパイル時間 207 ms
コンパイル使用メモリ 11,412 KB
実行使用メモリ 15,444 KB
最終ジャッジ日時 2023-08-28 17:32:33
合計ジャッジ時間 2,971 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
14,992 KB
testcase_01 AC 82 ms
15,300 KB
testcase_02 AC 83 ms
15,312 KB
testcase_03 AC 85 ms
15,084 KB
testcase_04 AC 86 ms
15,240 KB
testcase_05 AC 84 ms
14,992 KB
testcase_06 AC 86 ms
15,180 KB
testcase_07 AC 85 ms
15,088 KB
testcase_08 AC 91 ms
15,176 KB
testcase_09 AC 92 ms
15,328 KB
testcase_10 AC 93 ms
15,268 KB
testcase_11 AC 93 ms
15,444 KB
testcase_12 AC 95 ms
15,340 KB
testcase_13 AC 94 ms
15,288 KB
testcase_14 AC 94 ms
15,336 KB
testcase_15 AC 95 ms
15,404 KB
testcase_16 AC 81 ms
14,988 KB
testcase_17 AC 92 ms
15,108 KB
testcase_18 AC 94 ms
15,184 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:30: warning: `*' interpreted as argument prefix
Syntax OK

ソースコード

diff #

#!/usr/bin/ruby
h={}
r=[s=0]*5
5.times.map{|i|
	x,y=gets.split
	h[x]=[y.to_i,i]
}
n=[]
a=3.times.map{
	_h=Hash.new 0
	n0=gets.to_i
	n<<n0
	n0.times{_h[gets.chomp]+=1}
	_h
}
h.each{|x,(y,i)|
	r[i]+=5*a[0][x]*a[1][x]*a[2][x]
	s+=y*a[0][x]*a[1][x]*a[2][x]
}
=begin
a,b,c=3.times.map{n0=gets.to_i;n<<n0;n0.times.map{gets.chomp}}
a.product(b,c).map{|x,y,z|
	if x==y&&y==z
		r[h[x][1]]+=5
		s+=h[x][0]
	end
}
=end
p s*5.0/n[0]/n[1]/n[2]
p *r
0