题目链接: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. 第五章_JSTL

    5.1.下载JSTL http://jstl.java.net 5.2.JSTL类库 类别 下属功能 URI 前缀 Core 变量支持 http://java.sun.com/jsp/jstl/cor ...

  2. POJ 2738 Two Ends(记忆化)

    Description In the two-player game "Two Ends", an even number of cards is laid out in a ro ...

  3. MVC模型与FishiGUI应用层MVC型号

    MVC概要: MVC (Modal View Controler)M是指数据模型,V是指用户界面,C则是控制器. 使用MVC的目的是将M和V的实现代码分离,从而使同一个程序能够使用不同的表现形式.比方 ...

  4. 搬寝室 hdu

    Problem Description 搬寝室是很累的,xhd深有体会.时间追述2006年7月9号,那天xhd迫于无奈要从27号楼搬到3号楼,因为10号要封楼了.看着寝室里的n件物品,xhd开始发呆, ...

  5. RH033读书笔记(5)-Lab 6 Exploring the Bash Shell

    Lab 6 Exploring the Bash Shell Sequence 1: Directory and file organization 1. Log in as user student ...

  6. [WebGL入门]二十四,补色着色

    注:文章译自http://wgld.org/,原作者杉本雅広(doxas),文章中假设有我的额外说明,我会加上[lufy:],另外,鄙人webgl研究还不够深入,一些专业词语,假设翻译有误,欢迎大家指 ...

  7. 离PACKET_INp获取信息acket data

         于Floodlight模块假设要packet in消息,就对对应的消息类型进行监听就可以.然后在receive方法中就能够操纵这个上传上来的packet_in.      关键代码:   E ...

  8. 创建Oracle的用户 create user scott identified by tiger;

    在命令行里sqlplus 以system身份登录,password是自己设的system C:\Users\Administrator>sqlplus SQL*Plus: Release 10. ...

  9. Shuttle ESB 实践

    http://blog.csdn.net/liu765023051/article/category/2482069

  10. Java AIO 入门实例(转)

    Java7 AIO入门实例,首先是服务端实现: 服务端代码 SimpleServer: public class SimpleServer { public SimpleServer(int port ...