結果

問題 No.65 回数の期待値の練習
ユーザー terasaterasa
提出日時 2022-11-22 21:48:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 62 ms / 5,000 ms
コード長 552 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 81,560 KB
実行使用メモリ 68,064 KB
最終ジャッジ日時 2023-10-24 13:19:46
合計ジャッジ時間 2,359 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
68,064 KB
testcase_01 AC 62 ms
68,064 KB
testcase_02 AC 61 ms
68,064 KB
testcase_03 AC 59 ms
68,064 KB
testcase_04 AC 60 ms
68,064 KB
testcase_05 AC 58 ms
68,064 KB
testcase_06 AC 61 ms
68,064 KB
testcase_07 AC 61 ms
68,064 KB
testcase_08 AC 60 ms
68,064 KB
testcase_09 AC 61 ms
68,064 KB
testcase_10 AC 60 ms
68,064 KB
testcase_11 AC 61 ms
68,064 KB
testcase_12 AC 60 ms
68,064 KB
testcase_13 AC 60 ms
68,064 KB
testcase_14 AC 61 ms
68,064 KB
testcase_15 AC 61 ms
68,064 KB
testcase_16 AC 60 ms
68,064 KB
testcase_17 AC 61 ms
68,064 KB
testcase_18 AC 59 ms
68,064 KB
testcase_19 AC 60 ms
68,064 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from typing import List, Tuple, Callable, TypeVar
import sys
import itertools
import heapq
import bisect
import math
from collections import deque, defaultdict, Counter
from functools import lru_cache, cmp_to_key

input = sys.stdin.readline

if __file__ != 'prog.py':
    sys.setrecursionlimit(10 ** 6)


def readints(): return map(int, input().split())
def readlist(): return list(readints())
def readstr(): return input()[:-1]


K = int(input())

dp = [0] * (K + 10)
for i in range(K)[::-1]:
    dp[i] = sum(dp[i + 1:i + 6 + 1]) / 6 + 1
print(dp[0])
0