結果

問題 No.58 イカサマなサイコロ
ユーザー DialBirdDialBird
提出日時 2017-03-14 09:03:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 518 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 10,784 KB
実行使用メモリ 9,028 KB
最終ジャッジ日時 2023-09-12 12:19:18
合計ジャッジ時間 6,630 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 264 ms
9,028 KB
testcase_01 AC 887 ms
8,904 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 585 ms
8,904 KB
testcase_05 AC 673 ms
8,760 KB
testcase_06 AC 824 ms
8,832 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 824 ms
8,860 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from random import random

def my_randint(x,y):
    width = y - x + 1
    res = int(width * random()) + x - 1
    return res

N = int(input())
K = int(input())
trial = 100000

taro_win = 0

for _ in range(trial):
    taro_val = 0
    jiro_val = 0

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

    for i in range(N):
        jiro_val += my_randint(1,6)

    if taro_val > jiro_val:
        taro_win += 1

print(taro_win / trial)
0