結果

問題 No.212 素数サイコロと合成数サイコロ (2)
ユーザー e-mone-mon
提出日時 2015-05-22 22:42:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 385 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 10,804 KB
実行使用メモリ 12,664 KB
最終ジャッジ日時 2023-09-20 09:39:42
合計ジャッジ時間 7,099 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,272 KB
testcase_01 AC 18 ms
8,228 KB
testcase_02 AC 19 ms
8,096 KB
testcase_03 AC 19 ms
8,112 KB
testcase_04 AC 332 ms
8,108 KB
testcase_05 TLE -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import itertools

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

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

def dfs(P,C,k):
    ret = 0
    if P != 0:
        for p in pS:
            ret += dfs(P-1,C,k*p)
    elif C != 0:
        for c in cS:
            ret += dfs(0,C-1,k*c)
    else:
        return  k
    return ret

print(dfs(P,C,1) / ( 6**(P+C)))
0