結果
| 問題 | No.662 スロットマシーン |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-01-31 20:58:27 |
| 言語 | Ruby (4.0.2) |
| 結果 |
AC
|
| 実行時間 | 63 ms / 2,000 ms |
| コード長 | 435 bytes |
| 記録 | |
| コンパイル時間 | 176 ms |
| コンパイル使用メモリ | 9,216 KB |
| 実行使用メモリ | 14,976 KB |
| 最終ジャッジ日時 | 2026-06-03 17:29:47 |
| 合計ジャッジ時間 | 2,431 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
コンパイルメッセージ
Main.rb:30: warning: ambiguous `*` has been interpreted as an argument prefix Syntax OK
ソースコード
#!/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