結果
問題 | No.574 正多面体サイコロ |
ユーザー |
![]() |
提出日時 | 2025-03-25 06:32:12 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 36 ms / 2,000 ms |
コード長 | 500 bytes |
コンパイル時間 | 107 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2025-03-25 06:32:15 |
合計ジャッジ時間 | 1,882 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
ソースコード
F,N,K=map(int,input().split())Combi=[[] for i in range(N+1)]Combi[0]=[1,0]for i in range(1,N+1):Combi[i].append(1)for j in range(i):Combi[i].append(Combi[i-1][j]+Combi[i-1][j+1])Combi[i].append(0)LIST=[0]*(F+1)S=0for i in range(F,0,-1):ANS=0up=F-i+1#print(i,up,F-up)for j in range(K,N+1):ANS+=Combi[N][j]*pow(up,j)*pow(F-up,N-j)LIST[i]=ANS-SS+=LIST[i]S=0for i in range(len(LIST)):S+=i*LIST[i]print(S/sum(LIST))