結果

問題 No.65 回数の期待値の練習
ユーザー 🍡yurahuna🍡yurahuna
提出日時 2016-02-25 17:28:06
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 28 ms / 5,000 ms
コード長 177 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 11,852 KB
実行使用メモリ 10,156 KB
最終ジャッジ日時 2023-10-23 20:01:46
合計ジャッジ時間 1,807 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,140 KB
testcase_01 AC 28 ms
10,156 KB
testcase_02 AC 28 ms
10,156 KB
testcase_03 AC 27 ms
10,156 KB
testcase_04 AC 28 ms
10,156 KB
testcase_05 AC 27 ms
10,156 KB
testcase_06 AC 27 ms
10,156 KB
testcase_07 AC 27 ms
10,156 KB
testcase_08 AC 27 ms
10,156 KB
testcase_09 AC 27 ms
10,156 KB
testcase_10 AC 27 ms
10,156 KB
testcase_11 AC 27 ms
10,156 KB
testcase_12 AC 27 ms
10,156 KB
testcase_13 AC 27 ms
10,156 KB
testcase_14 AC 27 ms
10,156 KB
testcase_15 AC 27 ms
10,156 KB
testcase_16 AC 28 ms
10,156 KB
testcase_17 AC 28 ms
10,156 KB
testcase_18 AC 28 ms
10,156 KB
testcase_19 AC 28 ms
10,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-

K = int(input())
E = [0] * (K + 6)
for i in range(K)[::-1]:
    for j in range(1, 6 + 1):
        E[i] += E[i + j]
    E[i] = E[i] / 6 + 1

print(E[0])
0