結果

問題 No.75 回数の期待値の問題
ユーザー titiatitia
提出日時 2022-01-02 01:49:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,180 ms / 5,000 ms
コード長 200 bytes
コンパイル時間 224 ms
コンパイル使用メモリ 82,476 KB
実行使用メモリ 76,672 KB
最終ジャッジ日時 2024-04-19 04:50:40
合計ジャッジ時間 7,493 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
76,408 KB
testcase_01 AC 117 ms
76,544 KB
testcase_02 AC 124 ms
76,288 KB
testcase_03 AC 135 ms
76,544 KB
testcase_04 AC 115 ms
76,544 KB
testcase_05 AC 121 ms
76,672 KB
testcase_06 AC 114 ms
76,032 KB
testcase_07 AC 144 ms
76,360 KB
testcase_08 AC 140 ms
76,544 KB
testcase_09 AC 158 ms
76,416 KB
testcase_10 AC 144 ms
76,544 KB
testcase_11 AC 155 ms
76,544 KB
testcase_12 AC 154 ms
76,032 KB
testcase_13 AC 156 ms
76,032 KB
testcase_14 AC 171 ms
76,672 KB
testcase_15 AC 200 ms
76,496 KB
testcase_16 AC 520 ms
76,544 KB
testcase_17 AC 834 ms
76,032 KB
testcase_18 AC 1,180 ms
76,544 KB
testcase_19 AC 1,025 ms
76,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import random

K=int(input())

ANS=0
for i in range(10**5):
    A=0
    S=0
    while S!=K:
        S+=random.randint(1,6)
        A+=1

        if S>K:
            S=0
    ANS+=A

print(ANS/(10**5))
0