結果

問題 No.75 回数の期待値の問題
ユーザー yaoshimaxyaoshimax
提出日時 2015-03-01 16:28:18
言語 Python2
(2.7.18)
結果
AC  
実行時間 382 ms / 5,000 ms
コード長 268 bytes
コンパイル時間 473 ms
コンパイル使用メモリ 6,708 KB
実行使用メモリ 6,052 KB
最終ジャッジ日時 2023-09-06 05:52:09
合計ジャッジ時間 3,191 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 13 ms
6,004 KB
testcase_01 AC 16 ms
6,052 KB
testcase_02 AC 18 ms
5,888 KB
testcase_03 AC 26 ms
5,952 KB
testcase_04 AC 19 ms
6,008 KB
testcase_05 AC 21 ms
5,856 KB
testcase_06 AC 23 ms
6,028 KB
testcase_07 AC 27 ms
6,008 KB
testcase_08 AC 30 ms
5,864 KB
testcase_09 AC 31 ms
5,856 KB
testcase_10 AC 32 ms
5,816 KB
testcase_11 AC 35 ms
5,936 KB
testcase_12 AC 37 ms
5,804 KB
testcase_13 AC 38 ms
5,808 KB
testcase_14 AC 40 ms
5,936 KB
testcase_15 AC 50 ms
5,996 KB
testcase_16 AC 167 ms
5,836 KB
testcase_17 AC 293 ms
6,004 KB
testcase_18 AC 352 ms
5,892 KB
testcase_19 AC 382 ms
6,028 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

K=int(raw_input())
exp = [0.0 for i in range(K+1)]
for w in xrange(1000):
    for k in xrange(K-1,-1,-1):
        n=1.0
        for i in xrange(1,7):
            p = k+i
            if p > K:
                p = 0
            n+=exp[p]/6
        exp[k]=n
print exp[0]
0