题目链接:Codeforces 437A The Child and Homework

少看了一个条件,最后被HACK掉到203名,要不然就冲到100多一点了==。。

做这个题收获最大的是英语,A twice longer than B 表示 A >= 2 * B,A twice shorter than B表示 A * 2 <= B。

#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm> using namespace std; struct AA
{
int a, i;
}; int cmp(AA b, AA c)
{
return b.a < c.a;
} int main()
{
char a[120], b[120], c[120], d[120];
scanf("%s%s%s%s", a, b, c, d);
AA aa[4];
aa[0].a = strlen(a) - 2;
aa[0].i = 0;
aa[1].a = strlen(b) - 2;
aa[1].i = 1;
aa[2].a = strlen(c) - 2;
aa[2].i = 2;
aa[3].a = strlen(d) - 2;
aa[3].i = 3;
sort(aa, aa + 4, cmp);
int vis = 0;
int k;
if(aa[0].a * 2 <= aa[3].a && aa[0].a * 2 <= aa[2].a && aa[0].a * 2 <= aa[1].a)
{
vis++;
k = aa[0].i;
}
if(aa[3].a >= aa[0].a * 2 && aa[3].a >= aa[1].a * 2 && aa[3].a >= aa[2].a * 2)
{
vis++;
k = aa[3].i;
}
if(vis == 1)
cout << (char)(k + 'A') << endl;
else
cout << "C" << endl;
return 0;
}

Codeforces 437A The Child and Homework的更多相关文章

  1. codeforces 437A. The Child and Homework 解题报告

    题目链接:http://codeforces.com/problemset/problem/437/A 题目意思:给出四个选项A.B.C.D选项的内容描述,要求选出符合以下条件的一项. (1)如果某个 ...

  2. Codeforces Round #250 (Div. 2)—A. The Child and Homework

         好题啊,被HACK了.曾经做题都是人数越来越多.这次比赛 PASS人数 从2000直掉 1000人  被HACK  1000多人! ! ! ! 没见过的科技啊 1 2 4 8 这组数 被黑的 ...

  3. xtu read problem training 3 A - The Child and Homework

    The Child and Homework Time Limit: 1000ms Memory Limit: 262144KB This problem will be judged on Code ...

  4. Codeforces 437B The Child and Set

    题目链接:Codeforces 437B The Child and Set 開始是想到了这样的情况,比方lowbit之后从大到小排序后有这么几个数,200.100,60.50.S = 210.那先选 ...

  5. cf437A The Child and Homework

    A. The Child and Homework time limit per test 1 second memory limit per test 256 megabytes input sta ...

  6. Codeforces 437C The Child and Toy(贪心)

    题目连接:Codeforces 437C  The Child and Toy 贪心,每条绳子都是须要割断的,那就先割断最大值相应的那部分周围的绳子. #include <iostream> ...

  7. Codeforces 437E The Child and Polygon(间隔DP)

    题目链接:Codeforces 437E The Child and Polygon 题目大意:给出一个多边形,问说有多少种切割方法.将多边形切割为多个三角形. 解题思路:首先要理解向量叉积的性质,一 ...

  8. Codeforces 437D The Child and Zoo(贪心+并查集)

    题目链接:Codeforces 437D The Child and Zoo 题目大意:小孩子去參观动物园,动物园分非常多个区,每一个区有若干种动物,拥有的动物种数作为该区的权值.然后有m条路,每条路 ...

  9. Codeforces 437D The Child and Zoo(并查集)

    Codeforces 437D The Child and Zoo 题目大意: 有一张连通图,每个点有对应的值.定义从p点走向q点的其中一条路径的花费为途径点的最小值.定义f(p,q)为从点p走向点q ...

随机推荐

  1. 【Android进阶】Android面试题目整理与讲解(二)

    1. ArrayList,Vector, LinkedList 的存储性能和特性 ArrayList 和 Vector 都是使用数组方式存储数据,此数组元素数大于实际存储的数据以便增加和插入元素,它们 ...

  2. Codeforces Round #256 (Div. 2) A. Rewards

    A. Rewards time limit per test 1 second memory limit per test 256 megabytes input standard input out ...

  3. 左右Map

    Person p=new Person("黄雄"); Map map=new HashMap(); map.put("p", p); p.setName(&qu ...

  4. 取缔Chrome装载电脑管家的广告过滤脚本代码

    今天Chrome调试脚本.加载在下面的脚本中找到的内容: /* 电脑管家chrome 广告过滤 */ var GJAD_CS = { elemhideElt : null, setElemhideCS ...

  5. 微信电脑版(Mac和Windows)安装

    内容简介 1.微信Windows版 2.微信Mac版 3.总结优势 微信电脑版 众所周知,腾讯公司(马化腾先生执掌的巨头公司)开发的超成功App:微信.一经推出便引发业界轰动,使用人数更是直逼QQ. ...

  6. 做一个自动修改本机IP和mac的bat文件

    原文:做一个自动修改本机IP和mac的bat文件 1.ip bat修改理论探讨 前两天我突然萌生了一个念头:能不能做一个小程序来实现自动配置或修改IP和mac,达到一键搞定的目的,这样尤其适合那些带着 ...

  7. 【剑指offer】面试题28:弦乐

    def Permutation(data, i): if len( data ) == 0: return # i stand for the start of first part for i in ...

  8. Ubuntu Linux中开启MySQL远程访问功能

    为了给服务器一个真实的运行环境,今天在内网中部署了一台Ubuntu Linux服务器,其中最头疼的就是MySQL的安装,apt下载更新的速度太慢了,于是就自行编译了一下MySQL的源码,具体的编译方法 ...

  9. linuxIO刷新机制fsync和fdatasync详细解释

    前言: Linux,unix在内核中设有 缓冲区快速缓冲或页面快速缓冲.大多数磁盘I/O都通过缓冲进行,採用延迟写技术. sync:将全部改动过的快缓存区排入写队列.然后返回.并不等待实际写磁盘操作结 ...

  10. jconsole 连接 eclipse启动项

    eclipse 启动java项目默认情况下不开启jmx远程观看,假设需要看看内存使用情况对项目执行的线程等信息,能eclipse添加启动参数: -Dcom.sun.management.jmxremo ...