結果

問題 No.108 トリプルカードコンプ
ユーザー gigurururugigurururu
提出日時 2014-12-22 00:37:47
言語 Ruby
(3.3.0)
結果
AC  
実行時間 685 ms / 5,000 ms
コード長 182 bytes
コンパイル時間 41 ms
コンパイル使用メモリ 11,476 KB
実行使用メモリ 30,760 KB
最終ジャッジ日時 2023-08-27 05:25:17
合計ジャッジ時間 5,003 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
15,040 KB
testcase_01 AC 83 ms
15,016 KB
testcase_02 AC 83 ms
15,252 KB
testcase_03 AC 84 ms
15,112 KB
testcase_04 AC 83 ms
15,196 KB
testcase_05 AC 87 ms
15,120 KB
testcase_06 AC 82 ms
15,084 KB
testcase_07 AC 685 ms
30,760 KB
testcase_08 AC 94 ms
15,484 KB
testcase_09 AC 83 ms
15,088 KB
testcase_10 AC 82 ms
15,340 KB
testcase_11 AC 83 ms
15,116 KB
testcase_12 AC 82 ms
15,096 KB
testcase_13 AC 122 ms
16,272 KB
testcase_14 AC 96 ms
15,292 KB
testcase_15 AC 88 ms
15,000 KB
testcase_16 AC 107 ms
15,908 KB
testcase_17 AC 84 ms
15,252 KB
testcase_18 AC 513 ms
25,472 KB
testcase_19 AC 215 ms
18,784 KB
testcase_20 AC 135 ms
17,040 KB
testcase_21 AC 374 ms
23,444 KB
testcase_22 AC 92 ms
15,252 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:7: warning: `*' interpreted as argument prefix
Syntax OK

ソースコード

diff #

N=gets.to_f
H={[0]*3=>0}
def dfs a,b,c
a|b|c<0?0:H[[a,b,c]]||=(N+a*dfs(a-1,b+1,c)+b*dfs(a,b-1,c+1)+c*dfs(a,b,c-1))/(a+b+c)
end
a=gets.split.map &:to_i
p dfs *(0..2).map{|i|a.count i}
0