結果

問題 No.65 回数の期待値の練習
ユーザー Akijin_007Akijin_007
提出日時 2023-05-11 18:36:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 71 ms / 5,000 ms
コード長 235 bytes
コンパイル時間 325 ms
コンパイル使用メモリ 86,772 KB
実行使用メモリ 71,604 KB
最終ジャッジ日時 2023-08-18 10:59:29
合計ジャッジ時間 2,928 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,292 KB
testcase_01 AC 68 ms
71,356 KB
testcase_02 AC 70 ms
71,352 KB
testcase_03 AC 67 ms
71,400 KB
testcase_04 AC 70 ms
71,532 KB
testcase_05 AC 69 ms
71,524 KB
testcase_06 AC 70 ms
71,592 KB
testcase_07 AC 70 ms
71,548 KB
testcase_08 AC 69 ms
71,316 KB
testcase_09 AC 69 ms
71,460 KB
testcase_10 AC 70 ms
71,148 KB
testcase_11 AC 71 ms
71,364 KB
testcase_12 AC 69 ms
71,380 KB
testcase_13 AC 70 ms
71,156 KB
testcase_14 AC 70 ms
71,372 KB
testcase_15 AC 71 ms
71,380 KB
testcase_16 AC 68 ms
71,604 KB
testcase_17 AC 69 ms
71,448 KB
testcase_18 AC 69 ms
71,356 KB
testcase_19 AC 68 ms
71,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#int(input())
#map(int, input().split())
#list(map(int, input().split()))

K = int(input())
dp = [0] * 30

dp[0] = 1
for i in range(K-1, -1, -1):
    a = 0
    for j in range(6):
        a += dp[i+j+1]
    dp[i] = a/6 + 1

print(dp[0])
0