题目传送门

 /*
题意:两个人各掷两个骰子,给出每个骰子的最小值和最大值,其余值连续分布
问两人投掷,胜利的概率谁大
数据小,用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的更多相关文章

  1. CodeForcesGym 100502D Dice Game

    Dice Game Time Limit: 1000ms Memory Limit: 524288KB This problem will be judged on CodeForcesGym. Or ...

  2. LightOJ 1248 Dice (III) 概率

    Description Given a dice with n sides, you have to find the expected number of times you have to thr ...

  3. 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 ...

  4. Gym 101606F - Flipping Coins - [概率DP]

    题目链接:https://codeforc.es/gym/101606/problem/F 题解: 假设 $f[i][j]$ 表示抛 $i$ 次硬币,有 $j$ 个硬币正面朝上的概率. 所以只有两种挑 ...

  5. 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 ...

  6. hdu5955 Guessing the Dice Roll【AC自动机】【高斯消元】【概率】

    含高斯消元模板 2016沈阳区域赛http://acm.hdu.edu.cn/showproblem.php?pid=5955 Guessing the Dice Roll Time Limit: 2 ...

  7. Throwing Dice(概率dp)

    C - Throwing Dice Time Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Lig ...

  8. Project Euler 389 Platonic Dice (概率)

    题目链接: https://projecteuler.net/problem=389 题意: 掷一个正四面体骰子,记点数为\(T\). 掷\(T\)个正六面体骰子,记点数和为\(C\). 掷\(C\) ...

  9. hdu 4625 Dice(概率DP)

    Dice Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submi ...

随机推荐

  1. unity StreamingAssets路径

    原地址:http://blog.csdn.net/nateyang/article/details/8493791 我们在读写例如XML和TXT文件的时候,在电脑上和手机上路径不一致,造成了很多麻烦, ...

  2. 关于ruby重构的过程中去除不必要的format

    (文章是从我的个人主页上粘贴过来的,大家也可以访问我的主页 www.iwangzheng.com) #这段话可以由下面的话替代56     respond_to do |format|57       ...

  3. 他们在军训,我在搞 OI(一)

    Day 1 理论上,我现在不应该坐在电脑前打字,因为早在今天上午 6:20 全体新高一同学就坐车前往军(无)训(尽)基(炼)地(狱)了,而今天上午 6:20 我还在被窝里呢…… 没错,我旷掉了军训,然 ...

  4. RPM常用组合【转载】

    RPM常用组合 -ivh:安装显示安装进度--install--verbose--hash -Uvh:升级软件包--Update: -qpl:列出RPM软件包内的文件信息[Query Package ...

  5. python 异步线程简单实现

    import threading def foo(): with open(r'./result.log','wb') as f: f.write('=some logs here ==') t = ...

  6. 1-2+3-4+5-6+7......+n的几种实现

    本文的内容本身来自一个名校计算机生的一次面试经历,呵呵,没错,你猜对了,肯定 不是我 个人很喜欢这两道题,可能题目原本不止两道,当然,我这里这分析我很喜欢的两道. 1.写一个函数计算当参数为n(n很大 ...

  7. 使用pymongo需要手动关闭MongoDB Connection吗?

    答:Disconnecting will close all underlying sockets in the connection pool. If this instance is used a ...

  8. css3 变形(transform)、转换(transition)和动画(animation)

    http://www.w3cplus.com/content/css3-transform/  在CSS3中transform主要包括以下几种:旋转rotate.扭曲skew.缩放scale和移动tr ...

  9. css 属性

    部分属性在firefox 中添加-moz- safari 以及chrome  加上-webkit- opera 加上-o- ie9里可能需要-ms- jquery  中的css  操作  和一般的cs ...

  10. 16.O(logn)求Fibonacci数列[Fibonacci]

    [题目] log(n)时间Fib(n),本质log(n)求a^n. [代码]  C++ Code  12345678910111213141516171819202122232425262728293 ...