結果

問題 No.58 イカサマなサイコロ
ユーザー KudeKude
提出日時 2020-09-07 06:05:49
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 437 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 82,440 KB
実行使用メモリ 82,664 KB
最終ジャッジ日時 2024-05-06 23:20:22
合計ジャッジ時間 6,686 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

n = int(input())
k = int(input())
c1 = [0] * (6 * n + 1)
c2 = [0] * (6 * n + 1)
from itertools import product
for p in product([1,2,3,4,5,6], repeat=n):
    c1[sum(p)] += 1
for p1 in product([1,2,3,4,5,6], repeat=n-k):
    for p2 in product([4,4,5,5,6,6], repeat=k):
        c2[sum(p1)+sum(p2)] += 1
for i in range(6 * n - 1, -1, -1):
    c2[i] += c2[i+1]

wincnt = sum(c1[i] * c2[i+1] for i in range(6 * n))
print(wincnt / 6 ** (2 * n))
0