链接:http://codeforces.com/contest/437/problem/A

A. The Child and Homework
time limit per test

1 second

memory limit per test

256 megabytes

input

standard input

output

standard output

Once upon a time a child got a test consisting of multiple-choice questions as homework. A multiple-choice question consists of four choices: A, B, C and D. Each choice has a description, and the child should find out the only one that is correct.

Fortunately the child knows how to solve such complicated test. The child will follow the algorithm:

  • If there is some choice whose description at least twice shorter than all other descriptions, or at least twice longer than all other descriptions, then the child thinks the choice is great.
  • If there is exactly one great choice then the child chooses it. Otherwise the child chooses C (the child think it is the luckiest choice).

You are given a multiple-choice questions, can you predict child's choose?

Input

The first line starts with "A." (without quotes), then followed the description of choice A. The next three lines contains the descriptions of the other choices in the same format. They are given in order: B, C, D. Please note, that the description goes after prefix "X.", so the prefix mustn't be counted in description's length.

Each description is non-empty and consists of at most 100 characters. Each character can be either uppercase English letter or lowercase English letter, or "_".

Output

Print a single line with the child's choice: "A", "B", "C" or "D" (without quotes).

Sample test(s)
input
A.VFleaKing_is_the_author_of_this_problem
B.Picks_is_the_author_of_this_problem
C.Picking_is_the_author_of_this_problem
D.Ftiasch_is_cute
output
D
input
A.ab
B.abcde
C.ab
D.abc
output
C
input
A.c
B.cc
C.c
D.c
output
B
Note

In the first sample, the first choice has length 39, the second one has length 35, the third one has length 37, and the last one has length 15. The choice D (length 15) is twice shorter than all other choices', so it is great choice. There is no other great choices so the child will choose D.

In the second sample, no choice is great, so the child will choose the luckiest choice C.

In the third sample, the choice B (length 2) is twice longer than all other choices', so it is great choice. There is no other great choices so the child will choose B.

******************************************************

……………………………………………………………………………………………………………………

看了N久的题意,发现原来是英语词组不理解,英语水平太差

A twice longer than B 表示 A >= 2 * B,A twice shorter than B表示 A * 2 <= B

你知道吗???

 #include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <iostream> int main()
{
char str[][];
int len[];
for(int i=; i<=; i++)
{
scanf("%s",str[i]);
len[i]=strlen(str[i])-;
}
int xy=,dy=;
int flag=;
int ans=;
for(int i=; i<=; i++)
{
xy=;dy=;
for(int j=; j<=; j++)
{
if(i != j)
{
if(len[i]*<=len[j])
{
xy++;
}
if(len[i]>=len[j]*)
{
dy++;
}
}
}
if(xy> || dy>)
{
flag=i;
ans++;
//break;
}
}
if(flag && ans == )
{
printf("%c\n",flag+);
}
else if(flag == || ans != )
{
printf("C\n");
}
return ;
}

Codeforces Round #250 (Div. 2)A(英语学习)的更多相关文章

  1. Codeforces Round #707 (Div. 2)A.英语漏洞 + C.Going Home C题收获不小

    A题英语漏洞 A题传送门: https://codeforces.com/contest/1501/problem/A 其实题目说的很明白, 只是我傻傻的会错了意, 话不多说, 开整. 前两行是说, ...

  2. Codeforces Round #250 (Div. 1) D. The Child and Sequence (线段树)

    题目链接:http://codeforces.com/problemset/problem/438/D 给你n个数,m个操作,1操作是查询l到r之间的和,2操作是将l到r之间大于等于x的数xor于x, ...

  3. Codeforces Round #250 (Div. 1) D. The Child and Sequence 线段树 区间取摸

    D. The Child and Sequence Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest ...

  4. Codeforces Round #250 (Div. 1) B. The Child and Zoo 并查集

    B. The Child and Zoo Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/438/ ...

  5. Codeforces Round #250 (Div. 1) A. The Child and Toy 水题

    A. The Child and Toy Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/438/ ...

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

    注意题目长度不能考虑前缀,而且如果即存在一个选项的长度的两倍小于其他所有选项的长度,也存在一个选项的长度大于其他选项长度的两倍,则答案不是一个好的选择,只能选择C. #include <iost ...

  7. Codeforces Round #250 (Div. 2) C、The Child and Toy

    注意此题,每一个部分都有一个能量值v[i],他移除第i部分所需的能量是v[f[1]]+v[f[2]]+...+v[f[k]],其中f[1],f[2],...,f[k]是与i直接相连(且还未被移除)的部 ...

  8. Codeforces Round #250 (Div. 2)

    感觉不会再爱了,呜呜! A题原来HACK这么多!很多人跟我一样掉坑了! If there is some choice whose description at least twice shorter ...

  9. Codeforces Round #250 (Div. 2)——The Child and Set

    题目链接 题意: 给定goal和limit,求1-limit中的若干个数,每一个数最多出现一次,且这些数的lowbit()值之和等于goal,假设存在这种一些数,输出个数和每一个数:否则-1 分析: ...

随机推荐

  1. 【MFC三天一个游戏】之 局域网黑白棋

    欢迎加入我们的QQ群,无论你是否工作,学生,只要有c / vc / c++ 编程经验,就来吧!158427611 花了三天上班时间,妈的上班写就是不能静下心来,擦,要防BOSS巡山.... 以前也写过 ...

  2. 华为项目管理10大模板Excel版(可直接套用_非常实用)

    项目管理是管理学的一个分支学科 ,对项目管理的定义是:指在项目活动中运用专门的知识.技能.工具和方法,使项目能够在有限资源限定条件下,实现或超过设定的需求和期望的过程.项目管理是对一些与成功地达成一系 ...

  3. minio-dotnet --云存储服务

    inio是一家成立于2014年的生产开源云存储产品的新兴创业公司.这家创业公司是其创始人继Gluester之后的又一杰作,Gluester公司已经在2011年被Red Hat公司以1.36亿美元的价格 ...

  4. Linux下查看用户列表

    cat /etc/passwd 可以查看所有用户的列表 w 可以查看当前活跃的用户列表 cat /etc/group 查看用户组

  5. iOS学习之Table View的简单使用

    Table View简单描述: 在iPhone和其他iOS的很多程序中都会看到Table View的出现,除了一般的表格资料展示之外,设置的属性资料往往也用到Table View,Table View ...

  6. Codeforces 735D:Taxes(哥德巴赫猜想)

    http://codeforces.com/problemset/problem/735/D 题意:给出一个n,这个n可以分解成 n = n1 + n2 + -- + nk,其中k可以取任意数.要使得 ...

  7. SQLServer学习笔记<>相关子查询及复杂查询

    二.查询缺少值的查询 在这里我们加入要查询2008年每一天的订单有多少?首先我们可以查询下订单表的订单日期在2008年的所有订单信息. 1 select distinct orderdate,coun ...

  8. 1029 C语言文法定义与C程序的推导过程

    1 阅读并理解提供给大家的C语言文法文件. 2 参考该文件写出一个自己好理解版的现实版的完整版的C语言文法. 3 给出一段C程序,写出用上述文法产生这段C程序的推导过程. program → exte ...

  9. EFsql笔记

    like的语法 string[] cities = { "London", "Madrid" }; IQueryable<Customer> cus ...

  10. userdebug版本开机串口log打开

    在/bootable/bootloader/lk/app/mt_boot/mt_boot.c里修改: if (!has_set_p2u) { #ifdef USER_BUILD sprintf(cmd ...