結果
| 問題 |
No.65 回数の期待値の練習
|
| コンテスト | |
| ユーザー |
terasa
|
| 提出日時 | 2022-11-22 21:48:38 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 65 ms / 5,000 ms |
| コード長 | 552 bytes |
| コンパイル時間 | 167 ms |
| コンパイル使用メモリ | 82,004 KB |
| 実行使用メモリ | 69,484 KB |
| 最終ジャッジ日時 | 2024-09-23 05:40:29 |
| 合計ジャッジ時間 | 2,376 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 16 |
ソースコード
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])
terasa