結果

問題 No.75 回数の期待値の問題
ユーザー しらっ亭
提出日時 2015-09-14 01:13:36
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 277 bytes
コンパイル時間 121 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-19 06:24:32
合計ジャッジ時間 1,407 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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(ek / p[K])


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