結果

問題 No.212 素数サイコロと合成数サイコロ (2)
ユーザー koyoprokoyopro
提出日時 2015-09-20 11:28:34
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 369 bytes
コンパイル時間 689 ms
コンパイル使用メモリ 6,592 KB
実行使用メモリ 8,744 KB
最終ジャッジ日時 2023-09-26 14:00:55
合計ジャッジ時間 38,295 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

# -*- coding: utf-8 -*-

import random

P, C = map(int, raw_input().split())

primes = [2,3,5,7,11,13]
composite = [4,6,8,9,10,12]

total = 0
num = 1000000

for i in xrange(num):
    add = 1
    for p in xrange(P):
        add *= random.choice(primes)
    for c in xrange(C):
        add *= random.choice(composite)
    total += add

print "%.9f" % (1.0 * total / num)
0