結果

問題 No.212 素数サイコロと合成数サイコロ (2)
ユーザー titiatitia
提出日時 2022-06-30 02:50:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 5,000 ms
コード長 1,484 bytes
コンパイル時間 854 ms
コンパイル使用メモリ 10,900 KB
実行使用メモリ 8,440 KB
最終ジャッジ日時 2023-08-15 11:47:08
合計ジャッジ時間 977 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,220 KB
testcase_01 AC 16 ms
8,316 KB
testcase_02 AC 16 ms
8,368 KB
testcase_03 AC 16 ms
8,392 KB
testcase_04 AC 16 ms
8,408 KB
testcase_05 AC 16 ms
8,412 KB
testcase_06 AC 16 ms
8,408 KB
testcase_07 AC 16 ms
8,440 KB
testcase_08 AC 16 ms
8,356 KB
testcase_09 AC 16 ms
8,300 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ANSDICT={(0, 0): 1.0, (0, 1): 8.166666666666666, (0, 2): 66.69444444444444, (0, 3): 544.6712962962963, (0, 4): 4448.148919753086, (0, 5): 36326.54951131687, (1, 0): 6.833333333333333, (1, 1): 55.80555555555556, (1, 2): 455.7453703703704, (1, 3): 3721.920524691358, (1, 4): 30395.684284979423, (1, 5): 248231.4216606653, (2, 0): 46.69444444444444, (2, 1): 381.337962962963, (2, 2): 3114.2600308641977, (2, 3): 25433.123585390946, (2, 4): 207703.84261402607, (2, 5): 1696248.0480145463, (3, 0): 319.0787037037037, (3, 1): 2605.809413580247, (3, 2): 21280.776877572018, (3, 3): 173793.01116683814, (3, 4): 1419309.5911958448, (3, 5): 11591028.3280994, (4, 0): 2180.3711419753085, (4, 1): 17806.364326131687, (4, 2): 145418.6419967421, (4, 3): 1187585.5763067272, (4, 4): 9698615.539838273, (4, 5): 79205360.24201256, (5, 0): 14899.202803497943, (5, 1): 121676.8228952332, (5, 2): 993694.0536444044, (5, 3): 8115168.104762636, (5, 4): 66273872.85556153, (5, 5): 541236628.3204192}

print(ANSDICT[P,C])
exit()

# 以下を埋め込み

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

from itertools import product

ANSDICT=dict()

for P in range(6):
    for C in range(6):
        print(P,C)

        ANS=0
        for l in product(range(6),repeat=P+C):
            sc=1
            for i in range(P+C):

                if i<P:
                    sc*=X[l[i]]
                else:
                    sc*=Y[l[i]]
            ANS+=sc

        ANSDICT[P,C]=ANS/6**(P+C)
0