結果

問題 No.58 イカサマなサイコロ
ユーザー 👑 KazunKazun
提出日時 2020-10-03 02:55:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 4,790 ms / 5,000 ms
コード長 377 bytes
コンパイル時間 1,376 ms
コンパイル使用メモリ 86,716 KB
実行使用メモリ 78,880 KB
最終ジャッジ日時 2023-09-25 04:36:17
合計ジャッジ時間 54,429 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4,787 ms
78,508 KB
testcase_01 AC 4,790 ms
78,632 KB
testcase_02 AC 4,788 ms
78,472 KB
testcase_03 AC 4,789 ms
78,880 KB
testcase_04 AC 4,789 ms
78,500 KB
testcase_05 AC 4,785 ms
78,716 KB
testcase_06 AC 4,789 ms
78,488 KB
testcase_07 AC 4,790 ms
78,536 KB
testcase_08 AC 4,787 ms
78,424 KB
testcase_09 AC 4,787 ms
78,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from time import time
from random import randint as ri

N=int(input())
K=int(input())

START=time()
TIME_LIMIT=4.7

Battle=0
Win=0
while time()-START<=TIME_LIMIT:
    Battle+=1

    A=B=0
    for i in range(N):
        A+=ri(1,6)

    for i in range(N):
        if i<K:
            B+=ri(4,6)
        else:
            B+=ri(1,6)

    if A<B:
        Win+=1

print(Win/Battle)
0