結果
| 問題 |
No.65 回数の期待値の練習
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-09-01 16:18:37 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 40 ms / 5,000 ms |
| コード長 | 251 bytes |
| コンパイル時間 | 327 ms |
| コンパイル使用メモリ | 82,120 KB |
| 実行使用メモリ | 53,208 KB |
| 最終ジャッジ日時 | 2024-11-19 05:55:45 |
| 合計ジャッジ時間 | 2,277 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 16 |
ソースコード
K = int(input())
note = [0] * (K + 1)
def E(x):
if x < 1:
return 0
elif note[x] == 0:
note[x] = (E(x - 1) + E(x - 2) + E(x - 3) + E(x - 4) + E(x - 5) + E(x - 6)) / 6 + 1
return note[x]
print(E(K))