题目链接

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

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. threading.get_ident()

    https://docs.python.org/3/library/threading.html Return the 'thread identifier' of the current threa ...

  2. Redis 基础及各数据类型对应的命令

    Redis 命令文档 基本概念 安装及使用 可以在官网下载源码编译安装.对于 CentOS,还可以通过 yum install redis 安装. Redis 安装完成后,通过 redis-serve ...

  3. 解读:nginx的一个神秘配置worker_cpu_affinity

    今天在查看nginx的相关知识的时候发现了一个nginx之前不认识的配置:worker_cpu_affinity. nginx默认是没有开启利用多核cpu的配置的.需要通过增加worker_cpu_a ...

  4. C++ STL:优先队列的使用详解

    堆是一个很重要的数据结构,那么我们如何更加简洁的去写大根/小根堆呢? 对于很多语言来说,只能一步一步手打,但是对于C++来说,写大根小根堆就简便得多,因为C++中有一个容器叫做priority_que ...

  5. java--反射原理及操作

    1.反射原理 反射具体操作 15.反射的原理(********理解********) * 应用在一些通用性比较高的代码 中 * 后面学到的框架,大多数都是使用反射来实现的 * 在框架开发中,都是基于配 ...

  6. JNDI配置笔记

    先在tomcat Context.xml配置文件中配置 <Resource name="jdbc/elifecrm" type="javax.sql.DataSou ...

  7. 02 - Jmeter4.x正则表达式以及跨线程使用变量

    话不多说 直接开撸 上图可以看出,有两个请求,其中第二个请求返回了登录超时,结合第一个登录接口来看,这个是需要header请求内容的也就是 token:当然设置一个token又怎么可能难得倒我们,无非 ...

  8. spring-第八篇之容器中的bean的生命周期

    1.容器中的bean的生命周期 spring容器可以管理singleton作用域的bean的生命周期,包括bean何时被创建.何时初始化完成.何时被销毁.客户端代码不能控制该类型bean的销毁.spr ...

  9. POJ-1611.TheSuspects.(并查集)

    The Suspects Time Limit: 1000MS   Memory Limit: 20000K Total Submissions: 55832   Accepted: 26501 De ...

  10. 移动app云测试平台

    一:移动App云测试平台 1.云测试平台背景 随着智能手机的普及率和渗透率越来越高,App开发软件也越来越多.但是因为安卓和IOS的碎片化,尤其是安卓,因为完全开源的原因,导致设备繁多,品牌众多,版本 ...