题目链接

这题似乎就是纯概率论。。

E(V)=D(X_i)=npq  (p=1/m,p+q=1)

#include<bits/stdc++.h>
using namespace std;
typedef long long LL; LL n,m;
LL gcd(LL a,LL b)
{
return b?gcd(b,a%b):a;
} int main()
{
while(cin>>n>>m && n+m)
{
LL a=n*m-n,b=m*m;
LL g=gcd(a,b);
cout<<a/g<<'/'<<b/g<<endl;
}
}

hdu 5810:Balls and Boxes(期望)的更多相关文章

  1. HDU 5810 Balls and Boxes(盒子与球)

     Balls and Boxes(盒子与球) Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/O ...

  2. HDU 5810 Balls and Boxes (找规律)

    Balls and Boxes 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5810 Description Mr. Chopsticks is i ...

  3. HDU 5810 Balls and Boxes 数学

    Balls and Boxes 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5810 Description Mr. Chopsticks is i ...

  4. hdu 5810 Balls and Boxes 二项分布

    Balls and Boxes Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)T ...

  5. HDU 5810 Balls and Boxes ——(数学,概率,方差)

    官方题解看不太懂,参考了一些人的博客以后自己证明如下: 其中D(X)和E(X)的公式如下(参考自百度百科): 其中 p = 1 / m .(这是每一个单独事件发生的概率期望,在这里单独事件指的是一个球 ...

  6. HDU 5810 Balls and Boxes

    n*(m-1)/(m*m) #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio&g ...

  7. hdu-5810 Balls and Boxes(概率期望)

    题目链接: Balls and Boxes Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/O ...

  8. HDU5810 Balls and Boxes

    Balls and Boxes                                                                            Time Limi ...

  9. Codeforces Round #158 (Div. 2) C. Balls and Boxes 模拟

    C. Balls and Boxes time limit per test 1 second memory limit per test 256 megabytes input standard i ...

随机推荐

  1. drawArc

    1) 画笔设置 Paint.Style.STROKE 中空模式 paint = new Paint(); //新建一个画笔对象 paint.setAntiAlias(true);//抗锯齿功能 pai ...

  2. 阿里云code下载代码和更新代码

    1- 本地新建一个文件夹,进入文件夹下面右击打开git 2- Git init初始化一个.git文件夹 3- Git clone git@code.aliyun.com:username/space- ...

  3. jQuery AJAX and HttpHandlers in ASP.NET

    https://www.codeproject.com/Articles/170882/jQuery-AJAX-and-HttpHandlers-in-ASP-NET Introduction In ...

  4. PHP 三元运算符?:的小坑

    $a = ['result'=123]; $b = !empty($a['result'])?:-1; $c = !empty($a['result'])?$a['result']:-1; var_d ...

  5. JMeter 分布式调度压测部署

    我们遇到jmeter被假死死了,这里有2个原因,一是jmeter原本是java写的,heap受硬件限制需要调优,二是单机无法分解超大并发比如100万+并发压测,因此,我们分二部走,首先我们需要进行jm ...

  6. python 日期相关

    基本的日期与时间转换 问题 你需要执行简单的时间转换,比如天到秒,小时到分钟等的转换. 解决方案 为了执行不同时间单位的转换和计算,请使用 datetime 模块. 比如,为了表示一个时间段,可以创建 ...

  7. CDN:BootCDN 项目列表-摘录-20180405

    ylbtech-CDN:BootCDN 项目列表-20180405 1.返回顶部 1.   2. 2.返回顶部   3.返回顶部   4.返回顶部   5.返回顶部 1. http://www.boo ...

  8. mysql_DML_索引、视图

    创建索引的语法格式:– 创建普通索引:• create index 索引名称 on 表名(列)• alter table 表名 add index 索引名称 (列)– 创建唯一索引:• create ...

  9. day13—CSS之导航栏

    转行学开发,代码100天——2018-03-29 见过这么多网页,没有导航栏的几乎没见过.因此,对导航栏的练习非常之必要. 导航栏的实现,基本上都是通过链接列表实现,即ul->li->a标 ...

  10. 利用正则表达式模拟计算器进行字符串的计算实现eval()内置函数功能

    代码感觉有点绕,刚开始学习python,相关知识点还没全部学习到,还请各位大神多多指教 import re # 定义乘法 def mul(string): mul1 = re.search('-?\d ...