結果

問題 No.65 回数の期待値の練習
ユーザー noriocnorioc
提出日時 2023-08-15 01:23:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 48 ms / 5,000 ms
コード長 240 bytes
コンパイル時間 452 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 54,912 KB
最終ジャッジ日時 2024-05-02 13:51:19
合計ジャッジ時間 2,162 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
54,656 KB
testcase_01 AC 43 ms
54,528 KB
testcase_02 AC 45 ms
54,528 KB
testcase_03 AC 45 ms
54,272 KB
testcase_04 AC 44 ms
54,784 KB
testcase_05 AC 48 ms
54,784 KB
testcase_06 AC 43 ms
54,912 KB
testcase_07 AC 43 ms
54,912 KB
testcase_08 AC 43 ms
54,784 KB
testcase_09 AC 44 ms
54,400 KB
testcase_10 AC 44 ms
54,272 KB
testcase_11 AC 43 ms
54,400 KB
testcase_12 AC 45 ms
54,784 KB
testcase_13 AC 45 ms
54,528 KB
testcase_14 AC 43 ms
54,784 KB
testcase_15 AC 42 ms
54,912 KB
testcase_16 AC 43 ms
54,656 KB
testcase_17 AC 42 ms
54,528 KB
testcase_18 AC 43 ms
54,656 KB
testcase_19 AC 44 ms
54,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from functools import cache
import sys
sys.setrecursionlimit(10 ** 6)


@cache
def f(n: int):
    if n <= 0: return 0
    res = 1
    for i in range(1, 7):
        res += f(n - i) / 6
    return res


K = int(input())
ans = f(K)
print(ans)
0