結果
| 問題 | No.65 回数の期待値の練習 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-02-04 15:15:04 |
| 言語 | PyPy2 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 77 ms / 5,000 ms |
| コード長 | 230 bytes |
| 記録 | |
| コンパイル時間 | 138 ms |
| コンパイル使用メモリ | 77,588 KB |
| 最終ジャッジ日時 | 2025-12-03 13:34:50 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 16 |
ソースコード
def E(x,K):
if x >= K: return 0.0
else:
if memo[x]: return memo[x]
p = 1.0/6.0
memo[x] = sum(E(x+i,K)*p for i in range(1,7))+1
return memo[x]
K = int(raw_input())
memo = [0]*21
print E(0,K)