結果

問題 No.58 イカサマなサイコロ
ユーザー tnodinotnodino
提出日時 2022-02-26 19:15:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,276 ms / 5,000 ms
コード長 326 bytes
コンパイル時間 393 ms
コンパイル使用メモリ 86,856 KB
実行使用メモリ 78,564 KB
最終ジャッジ日時 2023-09-17 21:51:23
合計ジャッジ時間 9,119 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 389 ms
78,224 KB
testcase_01 AC 1,276 ms
78,564 KB
testcase_02 AC 386 ms
78,304 KB
testcase_03 AC 264 ms
78,480 KB
testcase_04 AC 865 ms
78,376 KB
testcase_05 AC 957 ms
78,280 KB
testcase_06 AC 1,168 ms
78,520 KB
testcase_07 AC 397 ms
78,176 KB
testcase_08 AC 616 ms
78,252 KB
testcase_09 AC 1,168 ms
78,432 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from random import randrange
INF = 10**6
N = int(input())
K = int(input())
cnt = 0
for _ in range(INF):
    A = 0
    B = 0
    for i in range(N):
        A += randrange(1,7)
    for i in range(N-K):
        B += randrange(1,7)
    for i in range(K):
        B += randrange(4,7)
    if A < B:
        cnt += 1
print(cnt / INF)
0