結果

問題 No.574 正多面体サイコロ
ユーザー はむこはむこ
提出日時 2017-04-27 10:40:07
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 385 bytes
コンパイル時間 472 ms
コンパイル使用メモリ 10,556 KB
実行使用メモリ 7,984 KB
最終ジャッジ日時 2023-10-11 15:59:40
合計ジャッジ時間 1,792 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
7,816 KB
testcase_01 AC 32 ms
7,744 KB
testcase_02 AC 23 ms
7,848 KB
testcase_03 AC 18 ms
7,796 KB
testcase_04 AC 16 ms
7,752 KB
testcase_05 AC 29 ms
7,820 KB
testcase_06 AC 17 ms
7,788 KB
testcase_07 AC 20 ms
7,824 KB
testcase_08 AC 16 ms
7,928 KB
testcase_09 AC 44 ms
7,748 KB
testcase_10 AC 63 ms
7,792 KB
testcase_11 AC 17 ms
7,924 KB
testcase_12 AC 23 ms
7,884 KB
testcase_13 AC 17 ms
7,940 KB
testcase_14 AC 23 ms
7,828 KB
testcase_15 AC 25 ms
7,836 KB
testcase_16 AC 17 ms
7,908 KB
testcase_17 AC 26 ms
7,820 KB
testcase_18 AC 57 ms
7,800 KB
testcase_19 AC 17 ms
7,984 KB
testcase_20 AC 16 ms
7,864 KB
testcase_21 AC 16 ms
7,832 KB
testcase_22 AC 102 ms
7,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

f, n, k = map(int, input().split())
fact = [1.0];
for i in range(1,200):
    fact.append(fact[i-1] * i)

ret = 0
for i in range(f):
    s = 0;
    for j in range(n):
        for h in range(n):
            if (j <= n - k and n - k <= n - h - 1):
                s += (fact[n] / fact[j] / fact[h] / fact[n-j-h]) * (i ** j) * ((f-i-1) ** h);
    ret += (i + 1) * s;

print(ret / (f ** n))
0