CCC '07 J2 - I Speak TXTMSG

View as PDF

Submit solution

Points: 3
Time limit: 2.0s
Memory limit: 256M

Problem type
Canadian Computing Competition: 2007 Stage 1, Junior #2

Text messaging using a cell phone is popular among teenagers. The messages can appear peculiar because short forms and symbols are used to abbreviate messages and hence reduce typing.

For example, LOL means "laughing out loud" and :-) is called an emoticon which looks like a happy face (on its side) and it indicates chuckling. This is all quite a mystery to some adults.

Write a program that will continually input a short form and output the translation for an adult using the following translation table:

Short Form Translation
CU see you
:-) I'm happy
:-( I'm unhappy
;-) wink
:-P stick out my tongue
(~.~) sleepy
TA totally awesome
CCC Canadian Computing Competition
CUZ because
TY thank-you
YW you're welcome
TTYL talk to you later

Input Specification

The user will enter text to be translated one line at a time. When the short form TTYL is entered, the program ends. Users may enter text that is found in the translation table, or they may enter other words. All entered text will be symbols or uppercase letters. There will be no spaces and no quotation marks.

Output Specification

The program will output text immediately after each line of input. If the input is one of the phrases in the translation table, the output will be the translation; if the input does not appear in the table, the output will be the original word. The translation of the last short form entered TTYL should be output.

Sample Input

CCC
:-)
SQL
TTYL

Sample Output

Canadian Computing Competition
I'm happy
SQL
talk to you later

Comments


  • 0
    R_G  commented on Jan. 30, 2024, 10:48 p.m.

    I put my code and than it says time limit exceeded (TLE). Anyone know what that means. That would be very helpful!


    • 0
      htoshiro  commented on Feb. 4, 2024, 1:56 p.m.

      your code doesn't terminate


      • 0
        R_G  commented on Feb. 4, 2024, 3:38 p.m. edited

        Damn

        it worked now

        TY


  • 2
    leoliu93233  commented on Jan. 1, 2024, 2:27 a.m.

    i want a updated 2023 version of this


    • 0
      Peter2023  commented on Jan. 11, 2024, 5:53 p.m.

      ong that would be fire fr :P =^.^= :3


      • 0
        R_G  commented on Feb. 4, 2024, 3:46 p.m.

        do u mean omg


  • 0
    maxcruickshanks  commented on Dec. 18, 2022, 4:33 a.m.

    Since the original data were weak (and malformed), the data were updated, and all submissions were rejudged.


  • -18
    唐天SaMa  commented on Nov. 27, 2020, 1:39 a.m.

    This comment is hidden due to too much negative feedback. Show it anyway.


    • 9
      Kirito  commented on Nov. 27, 2020, 2:46 a.m.

      Reread the input specification.

      The user will enter text to be translated one line at a time. When the short form TTYL is entered, the program ends. Users may enter text that is found in the translation table, or they may enter other words. All entered text will be symbols or upper case letters. There will be no spaces and no quotation marks.


  • 21
    Badmode  commented on Nov. 25, 2020, 6:18 p.m. edit 5

    Here are the translations for each TXTMSG, in Python dictionary:

    txt_diction = {'CU': 'see you', ':-)': "I'm happy", ':-(': "I'm unhappy", ';-)': 'wink', ':-p': 'stick out my tongue', '(~.~)': 'sleepy', 'TA': 'totally awesome', 'CCC': 'Canadian Computing Competition', 'CUZ': 'because', 'TY': 'thank-you', "YW": "you're welcome", 'TTYL': 'talk to you later'}