結果

問題 No.58 イカサマなサイコロ
ユーザー yuppe19 😺yuppe19 😺
提出日時 2015-04-24 23:29:33
言語 Python2
(2.7.18)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 601 bytes
コンパイル時間 539 ms
コンパイル使用メモリ 6,760 KB
実行使用メモリ 9,016 KB
最終ジャッジ日時 2023-09-18 09:53:20
合計ジャッジ時間 56,274 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4,963 ms
8,904 KB
testcase_01 WA -
testcase_02 AC 4,964 ms
8,920 KB
testcase_03 AC 4,963 ms
8,816 KB
testcase_04 AC 4,963 ms
8,884 KB
testcase_05 AC 4,963 ms
8,884 KB
testcase_06 AC 4,964 ms
9,016 KB
testcase_07 AC 4,963 ms
8,972 KB
testcase_08 AC 4,964 ms
8,940 KB
testcase_09 AC 4,963 ms
8,844 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python
# -*- coding: utf-8 -*-
# †
# (ΦωΦ)<運を天にまかせる系
from datetime import datetime, timedelta
from random import randint

start = datetime.now()
limit = timedelta(milliseconds=4949)

n = int(raw_input())
k = int(raw_input())

turn, win = 0, 0
for _ in xrange(19921223):
    turn += 1
    taro = sum(randint(1, 6) for _ in xrange(n-k)) \
         + sum(randint(4, 6) for _ in xrange(k))
    jiro = sum(randint(1, 6) for _ in xrange(n))
    if taro > jiro:
        win += 1
    now = datetime.now()
    if (now - start) >= limit:
        break
print float(win) / turn
0