题目传送门

 /*
题意:两个人各掷两个骰子,给出每个骰子的最小值和最大值,其余值连续分布
问两人投掷,胜利的概率谁大
数据小,用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. 快速诊断Linux性能

    导读 当你为了解决一个性能问题登录到一台 Linux 服务器:在第一分钟你应该检查些什么? 通过运行下面十个命令,你就能在六十秒内粗略地了解系统正在运行的进程及资源使用情况.通过查看这些命令输出的错误 ...

  2. @version ||= version

    # -*- encoding : utf-8 -*- class InterfaceBaseController < ActionController::Base private def set ...

  3. python4delphi 设置syspath

    详细看demo25的代码 These techniques are demonstrated in Demo25 in the examples folder of your Python for D ...

  4. poj3259 bellman——ford Wormholes解绝负权问题

    Wormholes Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 35103   Accepted: 12805 Descr ...

  5. PHP 的__call()

    PHP5 的对象新增了一个专用方法 __call(),这个方法用来监视一个对象中的其它方法.如果你试着调用一个对象中不存在或被权限控制中的方法,__call 方法将会被自动调用. 例七:__call ...

  6. jquery check box

    if ($("#eulaLine").is(':checked')) { var mobile = $("#mobile").val(); if (mobile ...

  7. 27.二元树的深度[BinaryTreeDepth]

    [题目] 输入一棵二元树的根结点,求该树的深度.从根结点到叶结点依次经过的结点(含根.叶结点)形成树的一条路径,最长路径的长度为树的深度. 例如 10                          ...

  8. 【转】打造属于自己的Android Studio神器

    本文转载自:http://www.stormzhang.com/android/2015/05/26/android-tools/,并加以修改.黄色底部分是本人添加的内容. 一晃好久没更新博客了,最近 ...

  9. Cocos2d 中的Sprite大小调整问题

    以前用UIImageView,比如  UIImageView *view = [[UIImageViewalloc] initWithImage:[UIImageimageNamed:@"b ...

  10. poj 2421 Constructing Roads 解题报告

    题目链接:http://poj.org/problem?id=2421 实际上又是考最小生成树的内容,也是用到kruskal算法.但稍稍有点不同的是,给出一些已连接的边,要在这些边存在的情况下,拓展出 ...