結果

問題 No.212 素数サイコロと合成数サイコロ (2)
コンテスト
ユーザー koheijkt
提出日時 2025-07-24 20:45:58
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 1,930 ms / 5,000 ms
+ 25µs
コード長 493 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 234 ms
コンパイル使用メモリ 95,860 KB
実行使用メモリ 84,480 KB
最終ジャッジ日時 2026-07-13 11:29:28
合計ジャッジ時間 4,799 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from itertools import product, combinations, permutations, groupby, accumulate
P, C = map(int, input().split())
sosu = [2, 3, 5, 7, 11, 13]
gose = [4, 6, 8, 9, 10, 12]

total = 0
for pat1 in product([i for i in range(6)], repeat=P):
    # P個の 0-5 の数字
    a = 1
    for num in pat1:
        a *= sosu[num]
    for pat2 in product([i for i in range(6)], repeat=C):
        b = a
        for num in pat2:
            b *= gose[num]
        total += b

ans = total/6**(P + C)
print(ans)
0