結果

問題 No.212 素数サイコロと合成数サイコロ (2)
ユーザー n_knuun_knuu
提出日時 2015-05-22 22:41:18
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 656 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 87,300 KB
実行使用メモリ 83,348 KB
最終ジャッジ日時 2023-09-20 09:39:13
合計ジャッジ時間 8,394 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 149 ms
79,452 KB
testcase_01 AC 164 ms
80,476 KB
testcase_02 AC 148 ms
79,324 KB
testcase_03 AC 161 ms
80,240 KB
testcase_04 AC 719 ms
83,348 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from functools import reduce
from operator import mul
from itertools import product, permutations, combinations, accumulate, cycle, combinations_with_replacement
from string import ascii_uppercase, ascii_lowercase, ascii_letters, digits, hexdigits, octdigits

prod = lambda l: reduce(mul, l, 1)
prodmod = lambda l, mod: reduce(lambda x, y: mul(x,y)%mod, l)

P, C = map(int, input().split())
saikoro = {}
for i in product([2,3,5,7,11,13], repeat=P):
    for j in product([4,6,8,9,10,12], repeat=C):
        p = prod(i)*prod(j)
        saikoro[p] = saikoro.get(p, 0) + 1

ans = 0
for key, cnt in saikoro.items():
    ans += key * cnt / (6**(P+C))
print(ans)
0