結果

問題 No.75 回数の期待値の問題
ユーザー yaoshimaxyaoshimax
提出日時 2015-03-01 16:27:37
言語 Python2
(2.7.18)
結果
AC  
実行時間 3,444 ms / 5,000 ms
コード長 269 bytes
コンパイル時間 69 ms
コンパイル使用メモリ 6,604 KB
実行使用メモリ 6,016 KB
最終ジャッジ日時 2023-09-06 05:53:56
合計ジャッジ時間 14,641 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
5,932 KB
testcase_01 AC 54 ms
5,936 KB
testcase_02 AC 73 ms
6,000 KB
testcase_03 AC 149 ms
5,880 KB
testcase_04 AC 93 ms
5,880 KB
testcase_05 AC 110 ms
5,832 KB
testcase_06 AC 126 ms
5,808 KB
testcase_07 AC 163 ms
6,008 KB
testcase_08 AC 179 ms
5,888 KB
testcase_09 AC 198 ms
5,908 KB
testcase_10 AC 221 ms
5,996 KB
testcase_11 AC 241 ms
5,804 KB
testcase_12 AC 252 ms
6,016 KB
testcase_13 AC 273 ms
5,884 KB
testcase_14 AC 276 ms
5,992 KB
testcase_15 AC 358 ms
5,996 KB
testcase_16 AC 1,451 ms
5,936 KB
testcase_17 AC 2,676 ms
5,884 KB
testcase_18 AC 3,267 ms
5,816 KB
testcase_19 AC 3,444 ms
5,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

K=int(raw_input())
exp = [0.0 for i in range(K+1)]
for w in xrange(10000):
    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