結果

問題 No.65 回数の期待値の練習
ユーザー Akijin_007
提出日時 2023-05-11 18:36:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 5,000 ms
コード長 235 bytes
コンパイル時間 325 ms
コンパイル使用メモリ 82,460 KB
実行使用メモリ 52,224 KB
最終ジャッジ日時 2024-11-27 15:19:08
合計ジャッジ時間 1,688 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

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