結果

問題 No.58 イカサマなサイコロ
ユーザー matsu7874matsu7874
提出日時 2014-11-21 09:23:23
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 499 bytes
コンパイル時間 626 ms
コンパイル使用メモリ 10,720 KB
実行使用メモリ 8,872 KB
最終ジャッジ日時 2023-08-30 22:07:03
合計ジャッジ時間 4,840 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import random

#N = 10
#K = 0

N = int(input())
K = int(input())

def dice1_6():
	return random.randint(1,6)

def dice4_6():
	return random.randint(4,6)

def main():
	trials = 100000
	taro_win = 0
	for i in range(trials):
		Taro = 0
#		Jiro = 0
#		for j in range(N):
#			Jiro += dice1_6()
		for j in range(N-K):
			Taro += dice1_6()
		for j in range(K):
			Taro += dice4_6()
		if Taro>3.5*N:
			taro_win += 1
	print(taro_win/trials)

if __name__ == '__main__':
	main()
0