题目传送门

  1. /*
  2. 题意:两个人各掷两个骰子,给出每个骰子的最小值和最大值,其余值连续分布
  3. 问两人投掷,胜利的概率谁大
  4. 数据小,用4个for 把所有的可能性都枚举一遍,统计每一次是谁胜利
  5. 还有更简单的做法,就是四个数相加比大小,ZT说是平均值,竟然被他水过去了:)
  6. */
  7. #include <cstdio>
  8. #include <iostream>
  9. #include <algorithm>
  10. #include <cstring>
  11. #include <string>
  12. #include <cmath>
  13. #include <set>
  14. #include <map>
  15. #include <queue>
  16. using namespace std;
  17. const int MAXN = 1e4 + ;
  18. const int INF = 0x3f3f3f3f;
  19. int main(void) //Gym 100502D Dice Game
  20. {
  21. //freopen ("D.in", "r", stdin);
  22. int a[], b[];
  23. for (int i=; i<; ++i)
  24. {
  25. scanf ("%d%d", &a[i], &b[i]);
  26. }
  27. int cnt1 = , cnt2 = ;
  28. for (int i=a[]; i<=b[]; ++i)
  29. {
  30. for (int j=a[]; j<=b[]; ++j)
  31. {
  32. for (int k=a[]; k<=b[]; ++k)
  33. {
  34. for (int l=a[]; l<=b[]; ++l)
  35. {
  36. if (i + j > k + l) cnt1++;
  37. else if (i + j < k + l) cnt2++;
  38. }
  39. }
  40. }
  41. }
  42. if (cnt1 > cnt2) puts("Gunnar");
  43. else if (cnt1 < cnt2) puts ("Emma");
  44. else puts ("Tie");
  45. return ;
  46. }
  47. /*
  48. Emma
  49. Tie
  50. Gunnar
  51. */

概率 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. Windows 的 AD 域寄生于 Linux 机器

    导读 对于帐户统一管理系统或软件来说,在 Linux 下你可能知道 NIS.OpenLDAP.samba 或者是 RedHat.IBM 的产品,在 Windows 下当然就是最出名的活动目录 (AD) ...

  2. unity3d 参考坐标系

    原地址:http://www.cnblogs.com/88999660/archive/2013/04/01/2993844.html 参考坐标系(Reference Coordinate Syste ...

  3. 关于DCMTK3.6.0源代码编译的总结

    1.DCMTK cmake出来的代码是一样的.MT和MD版本的区别在于DCMTK工程下的每个子工程的代码生成中的MT还是MD,只要修改成为相应的值就可以了. 2.依赖包的选择.依赖包必须与上面中所说的 ...

  4. HM必修3

    高中数学必修三 笔记与拓展 算法初步 算法是按照一定规则解决固定问题,通过对输入的某种变换产生结果. 素性测试 检验一个数是否为素数. 试除法 一个数是素数的充分必要条件是它因数个数为二.显然1和它本 ...

  5. Heap(堆)和stack(栈)有的区别是什么。

    java的内存分为两类,一类是栈内存,一类是堆内存.栈内存是指程序进入一个方法时,会为这个方法单独分配一块私属存储空间,用于存储这个方法内部的局部变量,当这个方法结束时,分配给这个方法的栈会释放,这个 ...

  6. Unable to mount the CD/DVD image virtualbox解决方法

    转自: http://askubuntu.com/questions/321589/unable-to-mount-the-cd-dvd-image-on-the-machine-sandbox

  7. MYSQL集群的搭建

    按照此配置完全可以配置成功!! 一.介绍========测试环境:Server1:ndbd 192.168.1.225Server2:ndbd 192.168.1.226Server3:mysqld ...

  8. 【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 ...

  9. codeforces C. Fixing Typos 解题报告

    题目链接:http://codeforces.com/problemset/problem/363/C 题目意思:纠正两种类型的typos.第一种为同一个字母连续出现3次以上(包括3次):另一种为两个 ...

  10. ubuntu tar 命令详细讲解

    Ubuntu--tar命令 tar zxvf ut6410-android2.1.tgz tar zcvf ut6410-android2.1.tgz ut6410-android2.1/ tar - ...