結果

問題 No.574 正多面体サイコロ
ユーザー vwxyzvwxyz
提出日時 2021-09-26 02:10:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 337 bytes
コンパイル時間 624 ms
コンパイル使用メモリ 10,904 KB
実行使用メモリ 7,916 KB
最終ジャッジ日時 2023-09-19 02:47:40
合計ジャッジ時間 2,902 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
7,780 KB
testcase_01 AC 29 ms
7,804 KB
testcase_02 AC 22 ms
7,804 KB
testcase_03 AC 19 ms
7,824 KB
testcase_04 AC 16 ms
7,824 KB
testcase_05 AC 28 ms
7,868 KB
testcase_06 AC 17 ms
7,860 KB
testcase_07 AC 19 ms
7,832 KB
testcase_08 AC 16 ms
7,824 KB
testcase_09 AC 41 ms
7,880 KB
testcase_10 AC 43 ms
7,828 KB
testcase_11 AC 17 ms
7,876 KB
testcase_12 AC 22 ms
7,800 KB
testcase_13 AC 18 ms
7,916 KB
testcase_14 AC 22 ms
7,872 KB
testcase_15 AC 17 ms
7,832 KB
testcase_16 AC 17 ms
7,824 KB
testcase_17 AC 25 ms
7,792 KB
testcase_18 AC 42 ms
7,828 KB
testcase_19 AC 18 ms
7,852 KB
testcase_20 AC 16 ms
7,796 KB
testcase_21 AC 16 ms
7,872 KB
testcase_22 AC 98 ms
7,872 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline=sys.stdin.readline

F,N,K=map(int,readline().split())
fact=[1]
for i in range(1,N+1):
    fact.append(fact[-1]*i)
K=N-K
ans=0
for i in range(K+1):
    for j in range(K+1,N+1):
        for f in range(F):
            ans+=pow(f,i)*pow(F-f-1,N-j)*(f+1)/(fact[i]*fact[j-i]*fact[N-j])
ans*=fact[N]
ans/=pow(F,N)
print(ans)
0