結果

問題 No.75 回数の期待値の問題
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2023-12-29 21:22:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 4,056 ms / 5,000 ms
コード長 429 bytes
コンパイル時間 347 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 77,084 KB
最終ジャッジ日時 2023-12-29 21:23:41
合計ジャッジ時間 86,286 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4,049 ms
76,828 KB
testcase_01 AC 4,050 ms
76,956 KB
testcase_02 AC 4,050 ms
76,824 KB
testcase_03 AC 4,056 ms
76,828 KB
testcase_04 AC 4,049 ms
77,084 KB
testcase_05 AC 4,050 ms
76,824 KB
testcase_06 AC 4,049 ms
76,824 KB
testcase_07 AC 4,050 ms
76,828 KB
testcase_08 AC 4,049 ms
76,828 KB
testcase_09 AC 4,051 ms
76,828 KB
testcase_10 AC 4,051 ms
76,828 KB
testcase_11 AC 4,050 ms
76,816 KB
testcase_12 AC 4,049 ms
76,816 KB
testcase_13 AC 4,050 ms
76,828 KB
testcase_14 AC 4,049 ms
76,816 KB
testcase_15 AC 4,051 ms
76,832 KB
testcase_16 AC 4,051 ms
76,824 KB
testcase_17 AC 4,050 ms
76,808 KB
testcase_18 AC 4,049 ms
76,804 KB
testcase_19 AC 4,050 ms
76,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math,time,random
input = sys.stdin.readline
start = time.time()
K = int(input())

cnt = 0
S = 0

while time.time() - start < 4:

    T = 0
    tS = 0
    while True:

        T += random.randint(1,6)
        tS += 1
        if T>K:
            T = 0
        if T==K:
            break
    S += tS
    cnt += 1
print(S/cnt)

0