22517_CountingSheep

2022-5-16 18:22| 发布者: Hocassian| 查看: 24| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-5-89506516680399-Problem List-采集的数据-后羿采集器.html

Pro.ID

22517

Title

Counting Sheep

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=22517

AC

39

Submit

139

Ratio

28.06%

时间&空间限制

  • Time Limit: 400/200 MS (Java/Others)     Memory Limit: 32768/32768 K (Java/Others)
  • 描述

    After a long night of coding, Charles Pearson Peterson is having trouble sleeping. This is not only because he is still thinking about the problem he is working on but also due to drinking too much java during the wee hours. This happens frequently, so Charles has developed a routine to count sheep. Not the animal, but the word. Speci cally, he thinks of a list of words, many of which are close in spelling to "sheep", and then counts how many actually are the word "sheep". Charles is always careful to be case-sensitive in his matching, so "Sheep" is not a match. You are to write a program that helps Charles count "sheep".

    输入

    Input will consist of multiple problem instances. The first line will consist of a single positive integer n ≤ 20, which is the number of problem instances. The input for each problem instance will be on two lines. The first line will consist of a positive integer m ≤ 10 and the second line will consist of m words, separated by a single space and each containing no more than 10 characters.

    输出

    Description

    After a long night of coding, Charles Pearson Peterson is having trouble sleeping. This is not only because he is still thinking about the problem he is working on but also due to drinking too much java during the wee hours. This happens frequently, so Charles has developed a routine to count sheep. Not the animal, but the word. Speci cally, he thinks of a list of words, many of which are close in spelling to "sheep", and then counts how many actually are the word "sheep". Charles is always careful to be case-sensitive in his matching, so "Sheep" is not a match. You are to write a program that helps Charles count "sheep".

    Input

    Input will consist of multiple problem instances. The first line will consist of a single positive integer n ≤ 20, which is the number of problem instances. The input for each problem instance will be on two lines. The first line will consist of a positive integer m ≤ 10 and the second line will consist of m words, separated by a single space and each containing no more than 10 characters.

    Output

    For each problem instance, you are to produce one line of output in the format:

    Case i: This list contains n sheep.

    The value of i is the number of the problem instance (we assume we start numbering at 1) and n is the number of times the word "sheep" appears in the list of words for that problem instance. Output lines should be separated by a single blank line.

    Sample Input

    4
    5
    shep sheeps sheep ship Sheep
    7
    sheep sheep SHEEP sheep shepe shemp seep
    10
    sheep sheep sheep sheep sheep sheep sheep sheep sheep sheep
    4
    shape buffalo ram goat

    Sample Output

    Case 1: This list contains 1 sheep.
    Case 2: This list contains 3 sheep.
    Case 3: This list contains 10 sheep.
    Case 4: This list contains 0 sheep.

    Source

    样例输入

    4
    5
    shep sheeps sheep ship Sheep
    7
    sheep sheep SHEEP sheep shepe shemp seep
    10
    sheep sheep sheep sheep sheep sheep sheep sheep sheep sheep
    4
    shape buffalo ram goat

    样例输出

    Case 1: This list contains 1 sheep.
    Case 2: This list contains 3 sheep.
    Case 3: This list contains 10 sheep.
    Case 4: This list contains 0 sheep.

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部