GFSSOC '17 J3 - AIF Essay

View as PDF

Submit solution

Points: 5
Time limit: 1.0s
Memory limit: 32M

Authors:
Problem type

Knowing that he needs to make up for his lack of programming experience, Ace has set out to write perfect essays for the AIF. He wants to show his excitement for Waterloo and thus has requested that you make a program for him that adds !!!EXCITEMENT!!! to his essay. What better way to show excitement than exclamation marks! Ace has written an essay of N (1 \le N \le 100) lines. Replace every period, ., with three exclamation marks, !!!. Additionally, any word in all uppercase should be surrounded by three exclamation marks on each side. For example, the word COMPUTER should become !!!COMPUTER!!!.

Note: punctuation other than periods should be treated as part of the original word, e.g. 1^ST becomes !!!1^ST!!!.

Input Specification

First line: N, the number of lines to follow.

Every even line: an integer k (1 \le k \le 200), the number of space-separated strings in the following line of text.

Every odd line: a line of his essay, no longer than 200 characters.

Output Specification

The essay with !!!excitement!!!.

Sample Input 1

2
8
My name is Ace Zhan. I love programming
9
and I want to be the BEST programmer alive.

Sample Output 1

My name is Ace Zhan!!! !!!I!!! love programming
and !!!I!!! want to be the !!!BEST!!! programmer alive!!!

Sample Input 2

2
9
Ever since Mr. Kong introduced me to computer science,
7
I have been hooked. <3 the man

Sample Output 2

Ever since Mr!!! Kong introduced me to computer science,
!!!I!!! have been hooked!!! <3 the man

Comments


  • 0
    BT  commented on Jan. 30, 2023, 2:36 a.m. edit 2

    Can a string be uppercase and then have a period at the end? I'm basically asking if there is a possibility to type 6 !s other than if there are two periods.


  • 1
    xiaowuc1  commented on Oct. 17, 2022, 7:07 p.m. edited

    The input data for this problem contained Unicode characters and have since been fixed to only contain ASCII characters. All out-of-contest submissions have been rejudged.


  • 0
    685446  commented on March 8, 2022, 9:23 p.m. edited

    Can i get some feedback?


    • 0
      Spitfire720  commented on March 8, 2022, 11:31 p.m. edit 2

      This may be a long shot, but the test case a A, with two whitespaces, fails.

      Also, you use twice the amount of memory than the limit. You may want to work on that first.


  • -1
    deleted  commented on Jan. 20, 2017, 11:10 p.m. edited

    What am I getting wrong?


    • 0
      P234rex  commented on Jan. 20, 2017, 11:24 p.m. edited

      Try to apply .upper to an int in your shell. You'll know what's wrong afterwards


      • 0
        deleted  commented on Jan. 20, 2017, 11:55 p.m. edited

        "123".upper() outputs 123? Is a word composed of only integers considered capitalized


        • 0
          tig567899  commented on Jan. 21, 2017, 12:02 a.m. edited

          No, I think the point was to recognize the opposite. Don't take integral values as capital letter words.


          • 0
            deleted  commented on Jan. 21, 2017, 12:42 a.m. edited

            wait so I'm not suppose to count it as a capital right


        • 0
          P234rex  commented on Jan. 21, 2017, 12:02 a.m. edited

          according to python yes


  • -1
    MajedAbdennadher  commented on Jan. 20, 2017, 8:19 p.m. edited

    It could've been a lot easier for you and me to restate the problem in a way that any decent human being can understand. Thanks <3


    • 0
      P234rex  commented on Jan. 20, 2017, 8:58 p.m. edited

      Any specific points of clarification that you need?


      • 0
        MajedAbdennadher  commented on Jan. 20, 2017, 9:06 p.m. edited

        hI my NaMe is ACE Zhan. => hI my NaMe is !!!ACE!!! Zhan!!!

        nice to met you Sir => nice to meet you Sir

        Williams the 4.th o => Williams the 4!!!th o

        Any insight why is thing wrong ? Sorry again :sad:


        • 0
          P234rex  commented on Jan. 20, 2017, 9:15 p.m. edit 2

          Your mistake occurs after that section. I don't wish to give too much away but look at the sample inputs and outputs carefully. Also consider what happens when you need to add more than one set of !!!