链接: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 ;
}

最新文章

  1. POJ1014 解题报告(DFS)
  2. 更改printk打印级别
  3. php 5.3开始使用mysqlnd作为的默认mysql访问驱动
  4. python自定义函数在Python解释器中调用
  5. Deployment of VC2008 apps without installing anything
  6. js 实现分割条
  7. Section 1.1 Your Ride Is Here
  8. JS函数的参数声明中用 var 与不用 var的区别
  9. Spring统一返回Json工具类,带分页信息
  10. 你必须知道的EntityFramework 6.x和EntityFramework Core变更追踪状态
  11. Error【0002】:YUM本地源配置问题
  12. SpringBoot技术栈搭建个人博客【后台开发】
  13. spring集成rabbitmq
  14. python 之 configparser 模块
  15. 4.3.6 对象的界定通过编写接口来访问带这类命名结构的表会出问题。如前所述,SQL Server的灵活性不应用作编写错误代码或创建问题对象的借口。 注意在使用Management Studio的脚本工具时,SQL Server会界定所有的对象。这不是因为这么做是必须的,也不是编写代码的最佳方式,而是因为在界定符中封装所有的对象,比编写脚本引擎来查找需要界定的对象更容易。
  16. 5.2 dubbo-compiler源码解析
  17. Nginx服务优化详解
  18. python pip 升级
  19. 使用ssm实现校验密码
  20. Javascript 中正则表达式验证网址

热门文章

  1. 161012、JAVA读写文件,如何避免中文乱码
  2. array DEMO
  3. php中替换函数主要用的几个函数strtr(),str_repalce()。
  4. JavaEE基础(四)
  5. C#中的托管和非托管
  6. HDU 1498:50 years, 50 colors(二分图匹配)
  7. recycleview + checkbox 实现单选
  8. Unity胶囊体的碰撞检测实现
  9. JAVA基础知识之JVM-——通过反射查看类信息
  10. ural 1109,NYOJ 239,匈牙利算法邻接表