結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 171 ms
8,892 KB
testcase_03 AC 114 ms
8,760 KB
testcase_04 AC 387 ms
8,724 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 552 ms
8,892 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(40000):
    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/40000)
0