結果

問題 No.65 回数の期待値の練習
ユーザー vwxyzvwxyz
提出日時 2021-07-27 16:00:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 278 ms / 5,000 ms
コード長 770 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 87,008 KB
実行使用メモリ 91,872 KB
最終ジャッジ日時 2023-09-30 19:20:07
合計ジャッジ時間 7,445 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 269 ms
91,452 KB
testcase_01 AC 271 ms
91,668 KB
testcase_02 AC 270 ms
91,872 KB
testcase_03 AC 270 ms
91,688 KB
testcase_04 AC 267 ms
91,672 KB
testcase_05 AC 272 ms
91,452 KB
testcase_06 AC 274 ms
91,856 KB
testcase_07 AC 275 ms
91,576 KB
testcase_08 AC 275 ms
91,796 KB
testcase_09 AC 270 ms
91,436 KB
testcase_10 AC 271 ms
91,684 KB
testcase_11 AC 269 ms
91,752 KB
testcase_12 AC 273 ms
91,636 KB
testcase_13 AC 273 ms
91,624 KB
testcase_14 AC 273 ms
91,556 KB
testcase_15 AC 275 ms
91,656 KB
testcase_16 AC 274 ms
91,684 KB
testcase_17 AC 278 ms
91,676 KB
testcase_18 AC 278 ms
91,604 KB
testcase_19 AC 270 ms
91,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
import copy
import decimal
import fractions
import heapq
import itertools
import math
import random
import sys
from collections import Counter,deque,defaultdict
from functools import lru_cache,reduce
from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max
def _heappush_max(heap,item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
def _heappushpop_max(heap, item):
    if heap and item < heap[0]:
        item, heap[0] = heap[0], item
        heapq._siftup_max(heap, 0)
    return item
from math import gcd as GCD, inf
read=sys.stdin.read
readline=sys.stdin.readline
readlines=sys.stdin.readlines

K=int(readline())
dp=[0]*(K+7)
for i in range(1,K+7):
    dp[i]=sum(dp[max(0,i-6):i])/6+1
ans=dp[K]
print(ans)
0