結果

問題 No.58 イカサマなサイコロ
ユーザー pluto77pluto77
提出日時 2017-07-19 09:54:48
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 1,838 ms / 5,000 ms
コード長 303 bytes
コンパイル時間 991 ms
コンパイル使用メモリ 77,312 KB
実行使用メモリ 95,104 KB
最終ジャッジ日時 2024-04-17 03:57:49
合計ジャッジ時間 13,494 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 617 ms
94,464 KB
testcase_01 AC 1,838 ms
94,720 KB
testcase_02 AC 618 ms
94,336 KB
testcase_03 AC 407 ms
94,464 KB
testcase_04 AC 1,307 ms
94,720 KB
testcase_05 AC 1,438 ms
95,104 KB
testcase_06 AC 1,735 ms
94,848 KB
testcase_07 AC 640 ms
94,464 KB
testcase_08 AC 955 ms
94,720 KB
testcase_09 AC 1,687 ms
94,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki_58
import random

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

res=0.0
r=3*10**6
for i in xrange(r):
 taro=jiro=0
 for i in xrange(n):
  jiro+=random.randint(1,6)
 for i in xrange(k):
  taro+=random.randint(4,6)
 for i in xrange(n-k):
  taro+=random.randint(1,6)
 if taro>jiro:
  res+=1
print 1.0*res/r
0