結果

問題 No.65 回数の期待値の練習
ユーザー takakintakakin
提出日時 2020-04-30 22:30:02
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 298 ms / 5,000 ms
コード長 190 bytes
コンパイル時間 948 ms
コンパイル使用メモリ 10,460 KB
実行使用メモリ 7,964 KB
最終ジャッジ日時 2023-08-22 19:16:18
合計ジャッジ時間 2,991 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,816 KB
testcase_01 AC 15 ms
7,808 KB
testcase_02 AC 15 ms
7,816 KB
testcase_03 AC 15 ms
7,804 KB
testcase_04 AC 15 ms
7,824 KB
testcase_05 AC 16 ms
7,820 KB
testcase_06 AC 16 ms
7,772 KB
testcase_07 AC 15 ms
7,820 KB
testcase_08 AC 16 ms
7,832 KB
testcase_09 AC 16 ms
7,964 KB
testcase_10 AC 16 ms
7,836 KB
testcase_11 AC 17 ms
7,824 KB
testcase_12 AC 17 ms
7,812 KB
testcase_13 AC 20 ms
7,856 KB
testcase_14 AC 25 ms
7,900 KB
testcase_15 AC 34 ms
7,884 KB
testcase_16 AC 52 ms
7,960 KB
testcase_17 AC 88 ms
7,784 KB
testcase_18 AC 159 ms
7,812 KB
testcase_19 AC 298 ms
7,892 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input=lambda: sys.stdin.readline().rstrip()
k=int(input())
def p(x):
  if x>=k:
    return 0
  else:
    return p(x+1)/6+p(x+2)/6+p(x+3)/6+p(x+4)/6+p(x+5)/6+p(x+6)/6+1
print(p(0))
0