結果

問題 No.65 回数の期待値の練習
ユーザー zazaboonzazaboon
提出日時 2017-05-15 12:58:45
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 180 bytes
コンパイル時間 397 ms
コンパイル使用メモリ 11,160 KB
実行使用メモリ 15,364 KB
最終ジャッジ日時 2023-10-14 13:12:00
合計ジャッジ時間 3,905 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
15,168 KB
testcase_01 AC 76 ms
15,080 KB
testcase_02 AC 75 ms
15,116 KB
testcase_03 AC 74 ms
15,224 KB
testcase_04 AC 74 ms
15,096 KB
testcase_05 AC 74 ms
15,136 KB
testcase_06 AC 75 ms
15,196 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

k = gets.chomp.to_i
ans = Array.new(20,0)
ans.size.times.with_index do |d, i|
  ans[i] = 1
  while(0 < i and (d - 6) < i )
    ans[d] += ans[i] / 6.0 
    i-=1
  end
end
p ans[k-1]
0