結果

問題 No.65 回数の期待値の練習
ユーザー brthyyjpbrthyyjp
提出日時 2021-06-18 20:10:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 74 ms / 5,000 ms
コード長 164 bytes
コンパイル時間 582 ms
コンパイル使用メモリ 87,152 KB
実行使用メモリ 71,684 KB
最終ジャッジ日時 2023-09-04 21:11:45
合計ジャッジ時間 3,617 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,492 KB
testcase_01 AC 71 ms
71,344 KB
testcase_02 AC 72 ms
71,496 KB
testcase_03 AC 71 ms
71,332 KB
testcase_04 AC 74 ms
71,684 KB
testcase_05 AC 73 ms
71,476 KB
testcase_06 AC 73 ms
71,336 KB
testcase_07 AC 72 ms
71,368 KB
testcase_08 AC 73 ms
71,368 KB
testcase_09 AC 73 ms
71,180 KB
testcase_10 AC 73 ms
71,340 KB
testcase_11 AC 73 ms
71,440 KB
testcase_12 AC 72 ms
71,672 KB
testcase_13 AC 73 ms
71,116 KB
testcase_14 AC 74 ms
71,396 KB
testcase_15 AC 72 ms
71,556 KB
testcase_16 AC 73 ms
71,620 KB
testcase_17 AC 72 ms
71,340 KB
testcase_18 AC 73 ms
71,472 KB
testcase_19 AC 72 ms
71,424 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

k = int(input())
dp = [0]*(k+10)
dp[k] = 0
for i in reversed(range(k)):
    dp[i] += 1
    for j in range(1, 7):
        dp[i] += dp[i+j]/6
#print(dp)
print(dp[0])
0