結果
| 問題 | No.65 回数の期待値の練習 |
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-20 21:16:02 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 40 ms / 5,000 ms |
| コード長 | 299 bytes |
| コンパイル時間 | 201 ms |
| コンパイル使用メモリ | 82,392 KB |
| 実行使用メモリ | 53,488 KB |
| 最終ジャッジ日時 | 2025-03-20 21:16:44 |
| 合計ジャッジ時間 | 1,805 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 16 |
ソースコード
K = int(input())
if K == 0:
print(0)
else:
E = [0.0] * K
for x in range(K-1, -1, -1):
total = 0.0
for i in range(1, 7):
next_x = x + i
if next_x < K:
total += E[next_x]
E[x] = total / 6 + 1
print("{0:.5f}".format(E[0]))
lam6er