結果

問題 No.212 素数サイコロと合成数サイコロ (2)
ユーザー roiti46roiti46
提出日時 2015-05-22 22:24:47
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 349 bytes
コンパイル時間 421 ms
コンパイル使用メモリ 6,724 KB
実行使用メモリ 6,512 KB
最終ジャッジ日時 2023-09-20 09:18:35
合計ジャッジ時間 10,079 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
6,084 KB
testcase_01 AC 22 ms
6,452 KB
testcase_02 AC 12 ms
6,084 KB
testcase_03 AC 19 ms
6,492 KB
testcase_04 AC 1,758 ms
6,512 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools as it
def calc(a):
    res = 1
    for i in a:
        res *= i
    return res
    
P, C = map(int, raw_input().split())
p = [2,3,5,7,11,13]
n = [4,6,8,9,10,12]

ans = 0.0
for pp in it.product(p, repeat = P):
    for nn in it.product(n, repeat = C):
        ans += 1.0 * calc(pp) * calc(nn) / (6.0 ** P * 6.0 ** C)
print "%.10f"%ans
0