概率 Gym 100502D Dice Game
- /*
- 题意:两个人各掷两个骰子,给出每个骰子的最小值和最大值,其余值连续分布
- 问两人投掷,胜利的概率谁大
- 数据小,用4个for 把所有的可能性都枚举一遍,统计每一次是谁胜利
- 还有更简单的做法,就是四个数相加比大小,ZT说是平均值,竟然被他水过去了:)
- */
- #include <cstdio>
- #include <iostream>
- #include <algorithm>
- #include <cstring>
- #include <string>
- #include <cmath>
- #include <set>
- #include <map>
- #include <queue>
- using namespace std;
- const int MAXN = 1e4 + ;
- const int INF = 0x3f3f3f3f;
- int main(void) //Gym 100502D Dice Game
- {
- //freopen ("D.in", "r", stdin);
- int a[], b[];
- for (int i=; i<; ++i)
- {
- scanf ("%d%d", &a[i], &b[i]);
- }
- int cnt1 = , cnt2 = ;
- for (int i=a[]; i<=b[]; ++i)
- {
- for (int j=a[]; j<=b[]; ++j)
- {
- for (int k=a[]; k<=b[]; ++k)
- {
- for (int l=a[]; l<=b[]; ++l)
- {
- if (i + j > k + l) cnt1++;
- else if (i + j < k + l) cnt2++;
- }
- }
- }
- }
- if (cnt1 > cnt2) puts("Gunnar");
- else if (cnt1 < cnt2) puts ("Emma");
- else puts ("Tie");
- return ;
- }
- /*
- Emma
- Tie
- Gunnar
- */
概率 Gym 100502D Dice Game的更多相关文章
- CodeForcesGym 100502D Dice Game
Dice Game Time Limit: 1000ms Memory Limit: 524288KB This problem will be judged on CodeForcesGym. Or ...
- LightOJ 1248 Dice (III) 概率
Description Given a dice with n sides, you have to find the expected number of times you have to thr ...
- hdu 4586 Play the Dice(概率dp)
Problem Description There is a dice with n sides, which are numbered from 1,2,...,n and have the equ ...
- Gym 101606F - Flipping Coins - [概率DP]
题目链接:https://codeforc.es/gym/101606/problem/F 题解: 假设 $f[i][j]$ 表示抛 $i$ 次硬币,有 $j$ 个硬币正面朝上的概率. 所以只有两种挑 ...
- Codeforces gym 101343 A. On The Way to Lucky Plaza【概率+逆元+精度问题】
2017 JUST Programming Contest 2.0 题目链接:http://codeforces.com/gym/101343/problem/A A. On The Way to ...
- hdu5955 Guessing the Dice Roll【AC自动机】【高斯消元】【概率】
含高斯消元模板 2016沈阳区域赛http://acm.hdu.edu.cn/showproblem.php?pid=5955 Guessing the Dice Roll Time Limit: 2 ...
- Throwing Dice(概率dp)
C - Throwing Dice Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu Lig ...
- Project Euler 389 Platonic Dice (概率)
题目链接: https://projecteuler.net/problem=389 题意: 掷一个正四面体骰子,记点数为\(T\). 掷\(T\)个正六面体骰子,记点数和为\(C\). 掷\(C\) ...
- hdu 4625 Dice(概率DP)
Dice Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Total Submi ...
随机推荐
- Windows 的 AD 域寄生于 Linux 机器
导读 对于帐户统一管理系统或软件来说,在 Linux 下你可能知道 NIS.OpenLDAP.samba 或者是 RedHat.IBM 的产品,在 Windows 下当然就是最出名的活动目录 (AD) ...
- unity3d 参考坐标系
原地址:http://www.cnblogs.com/88999660/archive/2013/04/01/2993844.html 参考坐标系(Reference Coordinate Syste ...
- 关于DCMTK3.6.0源代码编译的总结
1.DCMTK cmake出来的代码是一样的.MT和MD版本的区别在于DCMTK工程下的每个子工程的代码生成中的MT还是MD,只要修改成为相应的值就可以了. 2.依赖包的选择.依赖包必须与上面中所说的 ...
- HM必修3
高中数学必修三 笔记与拓展 算法初步 算法是按照一定规则解决固定问题,通过对输入的某种变换产生结果. 素性测试 检验一个数是否为素数. 试除法 一个数是素数的充分必要条件是它因数个数为二.显然1和它本 ...
- Heap(堆)和stack(栈)有的区别是什么。
java的内存分为两类,一类是栈内存,一类是堆内存.栈内存是指程序进入一个方法时,会为这个方法单独分配一块私属存储空间,用于存储这个方法内部的局部变量,当这个方法结束时,分配给这个方法的栈会释放,这个 ...
- Unable to mount the CD/DVD image virtualbox解决方法
转自: http://askubuntu.com/questions/321589/unable-to-mount-the-cd-dvd-image-on-the-machine-sandbox
- MYSQL集群的搭建
按照此配置完全可以配置成功!! 一.介绍========测试环境:Server1:ndbd 192.168.1.225Server2:ndbd 192.168.1.226Server3:mysqld ...
- 【JAVA、C++】LeetCode 019 Remove Nth Node From End of List
Given a linked list, remove the nth node from the end of list and return its head. For example, Give ...
- codeforces C. Fixing Typos 解题报告
题目链接:http://codeforces.com/problemset/problem/363/C 题目意思:纠正两种类型的typos.第一种为同一个字母连续出现3次以上(包括3次):另一种为两个 ...
- ubuntu tar 命令详细讲解
Ubuntu--tar命令 tar zxvf ut6410-android2.1.tgz tar zcvf ut6410-android2.1.tgz ut6410-android2.1/ tar - ...