結果

問題 No.58 イカサマなサイコロ
ユーザー fmhrfmhr
提出日時 2015-04-22 03:47:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 422 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 87,400 KB
実行使用メモリ 81,956 KB
最終ジャッジ日時 2023-09-18 07:55:29
合計ジャッジ時間 11,608 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 1,676 ms
79,212 KB
testcase_02 AC 526 ms
79,296 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 521 ms
80,360 KB
testcase_08 AC 859 ms
80,880 KB
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import random
N = int(input())
K = int(input())
win = 0
NUM = 300000
table = ([1] * K) + ([0] * (N-K))


random.seed()
for i in range(NUM):
    taro = 0
    jiro = 0
    for j in range(N):
        jiro += random.randrange(1, 7)
        if random.sample(table, 1) == [1]:
            taro += random.randrange(4, 7)
        else:
            taro += random.randrange(1, 7)
    if taro > jiro:
        win += 1
print(win/NUM)
0