#include <cstdio>
#include <algorithm>
using namespace std;
int p1,p2,a[6],T;
int main(){
scanf("%d",&T);
while(T--){
for(int i=0;i<6;i++)scanf("%d",&a[i]);
sort(a,a+6);
p1=a[4]+a[5];
p2=a[2]+a[3]+a[1];
if(p1>p2)puts("Grandpa Shawn is the Winner!");
else puts("What a sad story!");
}
return 0;
}

HDU 4931 Happy Three Friends的更多相关文章

  1. HDU 4931 Happy Three Friends(水)

    HDU 4931 Happy Three Friends 题目链接 题意:6个数字,一个取两个,妹子取三个,问最后谁会赢 思路:排个序,推断前两个和3 - 5个的和谁更大就可以 代码: #includ ...

  2. HDU题解索引

    HDU 1000 A + B Problem  I/O HDU 1001 Sum Problem  数学 HDU 1002 A + B Problem II  高精度加法 HDU 1003 Maxsu ...

  3. HDOJ 2111. Saving HDU 贪心 结构体排序

    Saving HDU Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total ...

  4. 【HDU 3037】Saving Beans Lucas定理模板

    http://acm.hdu.edu.cn/showproblem.php?pid=3037 Lucas定理模板. 现在才写,noip滚粗前兆QAQ #include<cstdio> #i ...

  5. hdu 4859 海岸线 Bestcoder Round 1

    http://acm.hdu.edu.cn/showproblem.php?pid=4859 题目大意: 在一个矩形周围都是海,这个矩形中有陆地,深海和浅海.浅海是可以填成陆地的. 求最多有多少条方格 ...

  6. HDU 4569 Special equations(取模)

    Special equations Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u S ...

  7. HDU 4006The kth great number(K大数 +小顶堆)

    The kth great number Time Limit:1000MS     Memory Limit:65768KB     64bit IO Format:%I64d & %I64 ...

  8. HDU 1796How many integers can you find(容斥原理)

    How many integers can you find Time Limit:5000MS     Memory Limit:32768KB     64bit IO Format:%I64d ...

  9. hdu 4481 Time travel(高斯求期望)(转)

    (转)http://blog.csdn.net/u013081425/article/details/39240021 http://acm.hdu.edu.cn/showproblem.php?pi ...

随机推荐

  1. CentOS 6.2图形界面自定义开启终端快捷键

    菜单: System->Preferences->Keyboard Shortcuts 在Desktop分类下找到"Run a terminal" 点击Run a te ...

  2. framework层和native层实现联网控制(iptable方式)

    最近工作中,需要开发一个功能----联网控制,这个功能其实用过root的安卓机应该都知道,禁止某个应用连接移动网络或者wifi. root后,通过su去执行iptable的命令就可以根据uid去控制应 ...

  3. 原生js判断某个元素是否有指定的class名的几种方法

    [注意]以下方法只对class只有一个值的情况下操作 ************************************************************* 结构部分: <d ...

  4. 有关std::map和std::vector的使用

    先说map吧. 最需要注意的就是:用下标访问map中的元素时,与使用下标访问vector的行为截然不同! 用下标访问不存在的元素时,将导致在map容器中添加一个新的元素,它的键即为该下标! 然而很多时 ...

  5. java——数据库——commons-DbUtils

    Apache Commons DbUtils Tutorial The Apache Commons DbUtils library is a small set of classes designe ...

  6. Hyper-v 安装CentOS

    http://www.cnblogs.com/dunitian/p/4976077.html

  7. day6_python学习笔记_chapter8_条件,循环

    1. if elif else 2. 条件表达式:三元操作符: smaller = x if x < y else y   == if x < y : smaller =x  else : ...

  8. Use eplipse to develop Python project

    Source: This is the example how to use eclipse and python. http://www.360doc.com/content/15/0206/10/ ...

  9. Cortex-M3动态加载三(模块调用系统函数)

    在我的arm动态加载实验中需要解决一个模块调用系统函数的问题,可以使用以下的一个方法.将系统函数固定在某一段地址空间,然后导出这一块的符号表到符号文件中,要记载的模块link的时候使用这个符号表文件, ...

  10. SeaJS 简单试用

    http://seajs.org/docs/#quick-start 感觉seajs的语法有点罗嗦... 它既有RequireJS的特点也有NodeJS引入模块的特点 例子是抄的官方的例子  在官方的 ...