Fleecing the Raffle
生活随笔
收集整理的這篇文章主要介紹了
Fleecing the Raffle
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
Fleecing the Raffle
Nordic Collegiate Programming Contest 2016.
題意
已經(jīng)有n張名片,加入x張你的名片,一次取出p張牌,求取出的p張牌中有且只有一張你的名片的最大概率是多少
分析
參考代碼
int main(void) {std::ios::sync_with_stdio(false);LL n,p ;while(cin>>n>>p){double x = n/(p-1);double ans = 1;ans *= p*x;ans *= exp(lgamma(n+1)-lgamma(n-p+2)-lgamma(n+x+1)+lgamma(n+x-p+1));printf("%0.8f\n",ans);}return 0; }2
gamma函數(shù)的應(yīng)用
轉(zhuǎn)載于:https://www.cnblogs.com/zzuzxy/p/8542615.html
總結(jié)
以上是生活随笔為你收集整理的Fleecing the Raffle的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 安装或卸载英特尔快速存储技术时,提示“此
- 下一篇: 【Uva 12093】Protectin