結果

問題 No.212 素数サイコロと合成数サイコロ (2)
ユーザー e-mone-mon
提出日時 2015-05-22 22:42:37
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,870 ms / 5,000 ms
コード長 385 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 87,064 KB
実行使用メモリ 80,424 KB
最終ジャッジ日時 2023-09-20 09:39:51
合計ジャッジ時間 4,464 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,348 KB
testcase_01 AC 80 ms
75,796 KB
testcase_02 AC 76 ms
71,208 KB
testcase_03 AC 84 ms
75,760 KB
testcase_04 AC 151 ms
77,776 KB
testcase_05 AC 1,870 ms
80,424 KB
testcase_06 AC 407 ms
78,180 KB
testcase_07 AC 403 ms
78,084 KB
testcase_08 AC 79 ms
75,904 KB
testcase_09 AC 78 ms
75,764 KB
権限があれば一括ダウンロードができます

ソースコード

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