链接: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. 第三方过滤器在TVideoGrabber中的使用

    在TVideoGrabber中可以使用第三方过滤器,并可插入到预览.录制或回放流中,添加到列表里. 要在一个图像中中应用一个过滤器,需要像下面的例子中一样调用 ThirdPartyFilter_Add ...

  2. js操作记录

    让checkbox全选 $("#checkall").click(function(){ $("input[name='checklist']").prop(& ...

  3. :parent 匹配含有子元素或者文本的元素

    描述: 查找所有含有子元素或者文本的 td 元素 HTML 代码: <table> <tr><td>Value 1</td><td>< ...

  4. FireDac 与数据库连接时字符集及对应的字段类型问题

    近日在一个过程调用时发生一个奇怪现象, 异常返回意思是说, 数据的长度是[6], 而字段定义的长度是[3].  分析后认为:  调用过程你不涉及到对返回数据集的字段手动定义问题, 出现这个问题应是两边 ...

  5. FreeOnTerminate 的线程在线程管理类的Destroy释放时手工释放的问题

    这个问题折腾了我整整一天. 有一个线程管理类,集中管理所有新建的线程, 线程统一在创建时标识 FreeOnTerminate 为 True. 因为有的线程是不限次循环的,所以在管理类最后 Destro ...

  6. Java中Synchronized的用法

    原文:http://blog.csdn.net/luoweifu/article/details/46613015 作者:luoweifu 转载请标名出处 <编程思想之多线程与多进程(1)——以 ...

  7. 7、XML加强/Web开发/Tomcat

    1 XML加强 XML加强 1)Dom4j修改XML文档 写出xml文档: XMLWriter writer = new XMLWriter() writer.wrtite(doc); 增加: Doc ...

  8. cocospod 安装和使用

    一 ruby 安装 要安装coocspod 首先需要安装ruby,可以先安装xcode,在安装macport 下载地址,最后执行命令 port install ruby 二.安装CocoaPods 1 ...

  9. pipe row的用法, Oracle split 函数写法.

    为了让 PL/SQL 函数返回数据的多个行,必须通过返回一个 REF CURSOR 或一个数据集合来完成.REF CURSOR 的这种情况局限于可以从查询中选择的数据,而整个集合在可以返回前,必须进行 ...

  10. ACM题目————The partial sum problem

    描述 One day,Tom’s girlfriend give him an array A which contains N integers and asked him:Can you choo ...