結果

問題 No.75 回数の期待値の問題
ユーザー しらっ亭
提出日時 2015-09-14 01:24:56
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 294 bytes
コンパイル時間 159 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-19 06:24:39
合計ジャッジ時間 1,520 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 3 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    K = int(input())

    p = [0] * (K + 1)

    p[0] = 1
    for i in range(1, K + 1):
        s = max(0, i - 6)
        p[i] = sum(p[j] / 6 for j in range(s, i))

    ek = 7 ** (K - 1) / 6 ** (K - 1)
    print('{:.5f}'.format(ek / p[K]))


if __name__ == '__main__':
    solve()
0