結果

問題 No.75 回数の期待値の問題
ユーザー tjaketjake
提出日時 2015-12-06 13:38:31
言語 Python2
(2.7.18)
結果
AC  
実行時間 38 ms / 5,000 ms
コード長 278 bytes
コンパイル時間 575 ms
コンパイル使用メモリ 6,748 KB
実行使用メモリ 6,116 KB
最終ジャッジ日時 2023-10-12 16:41:07
合計ジャッジ時間 1,729 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
5,964 KB
testcase_01 AC 12 ms
6,024 KB
testcase_02 AC 12 ms
5,964 KB
testcase_03 AC 13 ms
6,100 KB
testcase_04 AC 12 ms
6,116 KB
testcase_05 AC 13 ms
5,960 KB
testcase_06 AC 13 ms
6,116 KB
testcase_07 AC 13 ms
6,068 KB
testcase_08 AC 13 ms
5,952 KB
testcase_09 AC 13 ms
6,100 KB
testcase_10 AC 14 ms
6,008 KB
testcase_11 AC 14 ms
6,072 KB
testcase_12 AC 14 ms
5,964 KB
testcase_13 AC 14 ms
6,084 KB
testcase_14 AC 14 ms
5,968 KB
testcase_15 AC 15 ms
6,116 KB
testcase_16 AC 23 ms
5,952 KB
testcase_17 AC 32 ms
5,980 KB
testcase_18 AC 36 ms
5,972 KB
testcase_19 AC 38 ms
5,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

k = input()

left = 0
right = 300
c = [0]*(k+1)
for t in xrange(90):
    mid = (left + right) / 2.
    for x in xrange(k-1,-1,-1):
        c[x] = sum(mid if x+i>k else c[x+i] for i in xrange(1,7))/6.+1
    if c[0]>mid:
        left = mid
    else:
        right = mid
print left
0