結果

問題 No.58 イカサマなサイコロ
ユーザー kamomekamome
提出日時 2019-07-29 14:08:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 451 bytes
コンパイル時間 189 ms
コンパイル使用メモリ 10,856 KB
実行使用メモリ 8,908 KB
最終ジャッジ日時 2023-09-15 11:53:24
合計ジャッジ時間 11,702 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 481 ms
8,740 KB
testcase_01 AC 1,797 ms
8,836 KB
testcase_02 AC 477 ms
8,772 KB
testcase_03 AC 302 ms
8,864 KB
testcase_04 WA -
testcase_05 AC 1,305 ms
8,744 KB
testcase_06 WA -
testcase_07 AC 466 ms
8,776 KB
testcase_08 WA -
testcase_09 AC 1,591 ms
8,908 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python3
#!coding:utf-8
import random
def dice():
    return [1,2,3,4,5,6][random.randint(0,5)]
def cheat():
    return [4,5,6,4,5,6][random.randint(0,5)]
N=int(input())
K=int(input())
win=0
lose=0
for i in range(120003):
    m,n=0,0
    for j in range(N):
        m=m+dice()
    for k in range(N-K):
        n=n+dice()
    for l in range(K):
        n=n+cheat()
    if n>m:
        win=win+1
    else:
        lose=lose+1
print(win/120003)
0