結果

問題 No.65 回数の期待値の練習
ユーザー 👑 rin204rin204
提出日時 2022-01-20 20:50:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 206 ms / 5,000 ms
コード長 184 bytes
コンパイル時間 524 ms
コンパイル使用メモリ 87,284 KB
実行使用メモリ 79,228 KB
最終ジャッジ日時 2023-08-15 20:42:40
合計ジャッジ時間 3,689 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,496 KB
testcase_01 AC 78 ms
71,412 KB
testcase_02 AC 73 ms
71,448 KB
testcase_03 AC 75 ms
71,484 KB
testcase_04 AC 76 ms
71,500 KB
testcase_05 AC 75 ms
71,500 KB
testcase_06 AC 77 ms
71,488 KB
testcase_07 AC 76 ms
71,204 KB
testcase_08 AC 79 ms
75,708 KB
testcase_09 AC 81 ms
76,204 KB
testcase_10 AC 84 ms
76,512 KB
testcase_11 AC 93 ms
76,880 KB
testcase_12 AC 106 ms
78,640 KB
testcase_13 AC 115 ms
78,244 KB
testcase_14 AC 110 ms
77,952 KB
testcase_15 AC 117 ms
78,156 KB
testcase_16 AC 119 ms
78,872 KB
testcase_17 AC 133 ms
78,912 KB
testcase_18 AC 181 ms
78,836 KB
testcase_19 AC 206 ms
79,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

k = int(input())

def dfs(tot):
    if tot >= k:
        return 0
    
    ret = 0    
    for i in range(1, 7):
        ret += (dfs(tot + i) + 1) / 6
    return ret
    
print(dfs(0))
0