結果

問題 No.58 イカサマなサイコロ
ユーザー fmhrfmhr
提出日時 2015-04-22 03:51:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,176 ms / 5,000 ms
コード長 386 bytes
コンパイル時間 312 ms
コンパイル使用メモリ 86,968 KB
実行使用メモリ 78,720 KB
最終ジャッジ日時 2023-09-18 07:57:14
合計ジャッジ時間 7,976 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 357 ms
78,316 KB
testcase_01 AC 1,176 ms
78,304 KB
testcase_02 AC 346 ms
78,236 KB
testcase_03 AC 254 ms
78,156 KB
testcase_04 AC 797 ms
78,628 KB
testcase_05 AC 821 ms
78,568 KB
testcase_06 AC 1,056 ms
78,720 KB
testcase_07 AC 365 ms
78,208 KB
testcase_08 AC 563 ms
78,304 KB
testcase_09 AC 1,008 ms
78,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding=utf-8
import random
N = int(input())
K = int(input())
win = 0
NUM = 1000000

random.seed()
for i in range(NUM):
    taro = 0
    jiro = 0
    for j in range(N):
        jiro += random.randrange(1, 7)
    for k in range(K):
        taro += random.randrange(4, 7)
    for l in range(N-K):
        taro += random.randrange(1, 7)
    if taro > jiro:
        win += 1
print(win/NUM)
0