結果
| 問題 | No.65 回数の期待値の練習 |
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2024-08-26 23:33:51 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 51 ms / 5,000 ms |
| コード長 | 257 bytes |
| 記録 | |
| コンパイル時間 | 278 ms |
| コンパイル使用メモリ | 85,376 KB |
| 実行使用メモリ | 55,168 KB |
| 最終ジャッジ日時 | 2026-04-03 23:18:27 |
| 合計ジャッジ時間 | 2,980 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge3_1 |
| 純コード判定待ち |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 16 |
ソースコード
from functools import cache
import sys
sys.setrecursionlimit(10 ** 6)
@cache
def f(x: int) -> float:
if x <= 0: return 0
res = 0
for i in range(1, 7):
res += (f(x - i) + 1) / 6
return res
K = int(input())
ans = f(K)
print(ans)
norioc