CF437A.The Child and Homework
普及-
通过率:0%
时间限制:1.00s
内存限制:256MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
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?
从前,一个孩子拿到了一份由多项选择题组成的作业。每道多项选择题包含四个选项:A、B、C 和 D。每个选项都有一段描述,孩子需要从中找出唯一正确的那个选项。
幸运的是,孩子知道如何解答这种复杂的试题。孩子将遵循如下算法:
- 若存在某个选项,其描述长度至少是其余所有选项描述长度的两倍(即至少是其他所有描述长度的 2 倍或更长),或者其描述长度至多是其余所有选项描述长度的一半(即至多是其他所有描述长度的 1/2 或更短),则孩子认为该选项是“优秀的”(great)。
- 若恰好存在一个“优秀”的选项,则孩子选择它;否则,孩子选择 C(孩子认为 C 是最幸运的选项)。
现给出一道多项选择题,请你预测孩子将选择哪一个选项?
输入格式
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 "_".
第一行以 “A.”(不含引号)开头,随后是选项 A 的描述。接下来的三行按相同格式依次给出其余选项的描述:B、C、D。请注意,描述位于前缀 “X.” 之后,因此前缀本身不计入描述的长度。
每个描述非空,且长度至多为 100 个字符。每个字符可以是大写英文字母、小写英文字母或下划线 “_”。
输出格式
Print a single line with the child's choice: "A", "B", "C" or "D" (without quotes).
输出一行,内容为孩子的选择:“A”、“B”、“C” 或 “D”(不带引号)。
输入输出样例
输入#1
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
输出#1
D
输入#2
A.ab B.abcde C.ab D.abc
输出#2
C
输入#3
A.c B.cc C.c D.c
输出#3
B
说明/提示
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.
在第一个样例中,第一个选项的长度为 39,第二个选项的长度为 35,第三个选项的长度为 37,最后一个选项的长度为 15。选项 D(长度为 15)比其他所有选项的长度都短一半,因此它是一个“优秀选项”。不存在其他“优秀选项”,因此孩子将选择 D。
在第二个样例中,没有任何选项是“优秀选项”,因此孩子将选择最幸运的选项 C。
在第三个样例中,选项 B(长度为 2)比其他所有选项的长度都长一倍,因此它是一个“优秀选项”。不存在其他“优秀选项”,因此孩子将选择 B。
输入解题思路,AI测评打分。不知道怎么写?