HDU 4931 Happy Three Friends

题目链接

题意:6个数字,一个取两个,妹子取三个,问最后谁会赢

思路:排个序,推断前两个和3 - 5个的和谁更大就可以

代码:

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

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

  1. HDU 5578 Friendship of Frog 水题

    Friendship of Frog Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.ph ...

  2. HDU 5590 ZYB's Biology 水题

    ZYB's Biology Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid ...

  3. HDU 5538 L - House Building 水题

    L - House Building Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.ph ...

  4. HDU 4813 Hard Code(水题,2013年长春现场赛A题)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4813 签到题. 把一个字符串按照格式输出就可以了,很水 #include <stdio.h> ...

  5. HDU 4847 陕西邀请赛A(水)

    HDU 4847 Wow! Such Doge! pid=4847" style="">题目链接 题意:给定文本,求有几个doge,不区分大写和小写 思路:水题.直 ...

  6. hdu 5104 素数打表水题

    http://acm.hdu.edu.cn/showproblem.php?pid=5104 找元组数量,满足p1<=p2<=p3且p1+p2+p3=n且都是素数 不用素数打表都能过,数据 ...

  7. HDU 1062 Text Reverse(水题,字符串处理)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1062 解题报告:注意一行的末尾可能是空格,还有记得getchar()吃回车符. #include< ...

  8. hdu 1005:Number Sequence(水题)

    Number Sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)T ...

  9. hdu 1018:Big Number(水题)

    Big Number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total ...

随机推荐

  1. [转][Swust OJ 24]--Max Area(画图分析)

    转载自:http://www.cnblogs.com/hate13/p/4160751.html Max Area 题目描述:(链接:http://acm.swust.edu.cn/problem/2 ...

  2. 跟上节奏 大数据时代十大必备IT技能

    跟上节奏 大数据时代十大必备IT技能 新的想法诞生新的技术,从而造出许多新词,云计算.大数据.BYOD.社交媒体……在互联网时代,各种新词层出不穷,让人应接不暇.这些新的技术,这些新兴应用和对应的IT ...

  3. CCIE路由实验(4) -- BGP路由控制

    1.过滤BGP路由的方法2.用AS-path filter控制路由3.用Community Filter控制路由 enableconf tno ip do loenable pass ciscolin ...

  4. JSU省赛队员选拔赛个人赛1(Coin Change、Fibbonacci Number、Max Num、单词数、无限的路、叠筐)

    JSU省赛队员选拔赛个人赛1 一.题目概述: A.Coin Change(暴力求解.动态规划)     B.Fibbonacci Number(递推求解) C.Max Num(排序.比较) D.单词数 ...

  5. e-mail Web端管理

    邮件是和上海的一家微软的代理商合作的,管理很方便,但是目前感觉他家的邮件过滤机制有问题.

  6. Python中的循环与跳出

    --start-- for循环: for i in range(3): user_input = input("Your username:") passwd = int(inpu ...

  7. pyfits例子

    下面是一个读入fits文件,画积分强度图,再把某个星表里的天体画到图上的python程序. ====================================================== ...

  8. java--join方法

    package MyTest; class TestDemo implements Runnable { public void run() { int i = 0; for (int j = 0; ...

  9. Oracle百问百答(二)

    Oracle百问百答(二) 11. nvl函数有什么用? NVL( string1, replace_with) 功能:如果string1为NULL,则NVL函数返回replace_with的值,否则 ...

  10. ecosphere是什么意思_ecosphere的翻译_音标_读音_用法_例句 - 必应 Bing 词典

    ecosphere是什么意思_ecosphere的翻译_音标_读音_用法_例句 - 必应 Bing 词典 ecosphere