結果

問題 No.567 コンプリート
ユーザー yuruhiyayuruhiya
提出日時 2020-05-18 20:05:42
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 242 bytes
コンパイル時間 95 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 193,440 KB
最終ジャッジ日時 2024-04-09 21:34:24
合計ジャッジ時間 5,600 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 87 ms
12,288 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 83 ms
12,288 KB
testcase_12 AC 84 ms
12,160 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 TLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n = gets.to_i
dp = Array.new(n) { Array.new(6, 0.0) }
dp[0][0] = 1
n.pred.times do |i|
	6.times do |j|
		dp[i + 1][j] += dp[i][j] * (i.succ.to_f / 6)
		dp[i + 1][j + 1] += dp[i][j] * (1 - i.succ.to_f / 6) if j != 5
	end
end
puts dp[n - 1][5]
0