結果

問題 No.75 回数の期待値の問題
ユーザー mkawa2mkawa2
提出日時 2020-01-10 16:49:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,134 ms / 5,000 ms
コード長 332 bytes
コンパイル時間 1,119 ms
コンパイル使用メモリ 87,304 KB
実行使用メモリ 78,216 KB
最終ジャッジ日時 2023-08-15 14:30:49
合計ジャッジ時間 8,605 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 144 ms
77,952 KB
testcase_01 AC 150 ms
77,704 KB
testcase_02 AC 154 ms
77,840 KB
testcase_03 AC 168 ms
77,824 KB
testcase_04 AC 151 ms
77,784 KB
testcase_05 AC 151 ms
77,932 KB
testcase_06 AC 149 ms
77,980 KB
testcase_07 AC 173 ms
77,864 KB
testcase_08 AC 174 ms
77,864 KB
testcase_09 AC 173 ms
77,588 KB
testcase_10 AC 178 ms
77,672 KB
testcase_11 AC 186 ms
77,700 KB
testcase_12 AC 195 ms
77,632 KB
testcase_13 AC 198 ms
77,748 KB
testcase_14 AC 203 ms
77,920 KB
testcase_15 AC 224 ms
77,596 KB
testcase_16 AC 564 ms
77,640 KB
testcase_17 AC 902 ms
77,816 KB
testcase_18 AC 1,020 ms
78,108 KB
testcase_19 AC 1,134 ms
78,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10 ** 6)
from random import randrange

def II(): return int(sys.stdin.readline())

def main():
    k = II()
    throw=0
    turn=100000
    for _ in range(turn):
        s=0
        while s!=k:
            s+=randrange(1,7)
            throw+=1
            if s>k:s=0
    print(throw/turn)

main()
0