21374_SpellingBe

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

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

Pro.ID

21374

Title

Spelling Be

Title链接

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

AC

32

Submit

122

Ratio

26.23%

时间&空间限制

  • Time Limit: 600/300 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    It's a simple requirement your company has, really — every document should be spell-checked before it's sent out to a customer. Unfortunately, while word processing documents are easily spell-checked, your employees have not been checking email every time they send out a message. So you've come up with a little improvement. You are going to write a program that will check email on its way out. You will spell-check each message, and if you find any spelling errors, it will be returned to the sender for correction.

    When you announced this plan, one of your coworkers fell off their chair laughing, saying that you couldn't possibly anticipate every name, technical acronym, and other terms that might appear in an email. Undaunted, however, you are going to test-run your code with an online dictionary and some sample emails you have collected.

    输入

    The input consists of two sections, the dictionary and the emails. The first line of input specifies the number of words in the dictionary, followed by that many lines, with one word per line. There is no whitespace before, after, or in any words,although there may be apostrophes or hyphens in the words, which are considered part of the word (i.e. "bobs" is different than "bob's". There will be no duplicate words. All words will be in lower case.

    Following that are the emails. The first line of this section has the number of emails in the input. Following that line begins the first email. It has been preprocessed, so it consists of one word per line, with no punctuation (other than apostrophes and hyphens) or whitespace, and all words are in lower case. The last word in the email is followed by a line with only "-1". Each email will have at least one word.

    输出

    Description

    It's a simple requirement your company has, really — every document should be spell-checked before it's sent out to a customer. Unfortunately, while word processing documents are easily spell-checked, your employees have not been checking email every time they send out a message. So you've come up with a little improvement. You are going to write a program that will check email on its way out. You will spell-check each message, and if you find any spelling errors, it will be returned to the sender for correction.

    When you announced this plan, one of your coworkers fell off their chair laughing, saying that you couldn't possibly anticipate every name, technical acronym, and other terms that might appear in an email. Undaunted, however, you are going to test-run your code with an online dictionary and some sample emails you have collected.

    Input

    The input consists of two sections, the dictionary and the emails. The first line of input specifies the number of words in the dictionary, followed by that many lines, with one word per line. There is no whitespace before, after, or in any words,although there may be apostrophes or hyphens in the words, which are considered part of the word (i.e. "bobs" is different than "bob's". There will be no duplicate words. All words will be in lower case.

    Following that are the emails. The first line of this section has the number of emails in the input. Following that line begins the first email. It has been preprocessed, so it consists of one word per line, with no punctuation (other than apostrophes and hyphens) or whitespace, and all words are in lower case. The last word in the email is followed by a line with only "-1". Each email will have at least one word.

    Output

    For each email, you must either print:

    Email X is spelled correctly.

    where Xbegins with 1 and counts up. Or, if a word is found that is not in the dictionary, print out:

    Email X is not spelled correctly.

    followed by a list of unknown words in the order that you find them, one per line. If an unknown word is found multiple times, it should be printed multiple times.

    There are no spaces between datasets. Following the output for the final dataset, print a line stating "End of Output".

    Sample Input

    6
    alice
    am
    bitterly
    i
    leaving
    you
    1
    dear
    bob
    i
    am
    leaving
    you
    bitterly
    alice
    -1

    Sample Output

    Email 1 is not spelled correctly.
    dear
    bob
    End of Output

    Source

    样例输入

    6
    alice
    am
    bitterly
    i
    leaving
    you
    1
    dear
    bob
    i
    am
    leaving
    you
    bitterly
    alice
    -1

    样例输出

    Email 1 is not spelled correctly.
    dear
    bob
    End of Output

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部