結果

問題 No.65 回数の期待値の練習
ユーザー yuki2006yuki2006
提出日時 2014-11-09 20:49:11
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 222 bytes
コンパイル時間 130 ms
コンパイル使用メモリ 6,568 KB
実行使用メモリ 6,044 KB
最終ジャッジ日時 2023-08-30 02:48:02
合計ジャッジ時間 2,053 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,024 KB
testcase_01 AC 12 ms
5,848 KB
testcase_02 AC 12 ms
5,844 KB
testcase_03 AC 11 ms
5,836 KB
testcase_04 AC 11 ms
6,044 KB
testcase_05 AC 12 ms
6,012 KB
testcase_06 AC 12 ms
5,836 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 -
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-

N = int(raw_input())

E = [0.0 for _ in xrange(N + 1)]
E[0] = 1

for i in xrange(1, N + 1):
    for j in xrange(1, min(i, 6 + 1)):
        E[i] += E[j] / 6
    E[i] += 1
print E[N]


0