HDUBoard Game Dice (数学期望)
来源:互联网 发布:2017广州恒大淘宝赛程表 编辑:程序博客网 时间:2024/05/29 15:03
推出的公式是M^x*x/N,大概意思是M^x*x这些种可能后一定会找出一个裁判,在除以N为数学期望。
可能和数学公式还有关系。
#include<stdio.h>#include<math.h>__int64 gcd(__int64 a,__int64 b){ return b == 0 ? a : gcd(b, a%b);}int main(){ __int64 i,j,n,m,t,x,a,b,temp,sum; scanf("%I64d",&t); for(i=1;i<=t;i++){ scanf("%I64d%I64d",&n,&m); for(x=1,sum=1;;x++){ sum*=m; if( sum>=n ) break; } sum*=x; temp=gcd(sum,n); printf("Case %I64d: %I64d/%I64d\n",i,sum/temp,n/temp); } return 0;}
0 0
- HDUBoard Game Dice (数学期望)
- LightOJ-1248-Dice (III) (数学期望)
- 【jzoj100004】【Dice】【数学期望】
- Play the Dice(数学期望)
- HDU 4518 Play the Dice(数学 概率 期望)
- HDU 4586 Play the Dice 数学期望
- HDU 4586 Play the dice (数学期望)
- 阿里巴巴公开赛 HDU 3959 Board Game Dice(数学)
- hdu - 3959 Board Game Dice(数学)
- ZOJ3329-One Person Game(概率DP求数学期望)
- Play the Dice hdu 4586 数学期望的问题
- light oj 1248 - Dice (III)(期望)
- HDU4586 Play the Dice (期望)
- hdu 3750 Guess Game 数学期望
- Candy( 数学期望 )
- uva10288(数学期望)
- uva12230(数学期望)
- 数学期望(360)
- linux 内存的查看
- 双向链表的插入及删除图解
- iOS-UIPopoverController(ipad)
- Shark机器学习开源库Win平台下的安装与示例程序
- Linux网络编程——绑定( bind )端口需要注意的问题
- HDUBoard Game Dice (数学期望)
- Android 监听apk安装替换卸载广播的实现代码
- Body Language
- 100层鸡蛋最优解
- VS2012左侧不能打断点
- Android:圆角和边框
- OC_01_基础
- java内部类定义
- FrameAnimation动画END监听