CCC '13 J2 - Rotating letters

View as PDF

Submit solution


Points: 5
Time limit: 2.0s
Memory limit: 64M

Problem type

Canadian Computing Competition: 2013 Stage 1, Junior #2

An artist wants to construct a sign whose letters will rotate freely in the breeze. In order to do this, she must only use letters that are not changed by rotation of 180 degrees: I, O, S, H, Z, X, and N.

Write a program that reads a word and determines whether the word can be used on the sign.

Input Specification

The input will consist of one word, all in uppercase letters, with no spaces. The maximum length of the word will be 30 letters, and the word will have at least one letter in it.

Output Specification

Output YES if the input word can be used on the sign; otherwise, output NO.

Sample Input 1

SHINS

Output for Sample Input 1

YES

Sample Input 2

NOISE

Output for Sample Input 2

NO

Comments


  • 3
    Raymo111  commented on Aug. 7, 2018, 9:34 a.m.

    I like how NO is a valid word but YES isn't :)


  • -5
    loltrollkill  commented on Aug. 6, 2018, 7:17 p.m.

    Dear Haters: Some answers are very good, but you somehow dislike it. Like what bro? I don't care if you ban me for this comment, this is just an alt :D


  • -5
    gabe  commented on April 17, 2018, 6:48 p.m.

    PLS HELP!!!!!!!!!!!!!!

    [user:gabe ]


  • -1
    gabe  commented on April 15, 2018, 1:19 p.m.

    how do u change ur avatar?!


    • 6
      KevinLu  commented on April 16, 2018, 6:27 p.m.

      You need to link your account to Gravatar (through email).

      Edit your profile here and scroll down until you find "Change your avatar".


  • -3
    gabe  commented on April 15, 2018, 1:19 p.m.

    wut.

    hi


  • -17
    BULLET999  commented on Dec. 19, 2017, 10:43 p.m.

    i just noticed something..... the reversible letters are already listed...


  • -6
    cardistryMagic  commented on March 1, 2017, 12:28 p.m.

    Last batch not working, sorry for asking, but I really don't know why. pls help.


    • -9
      Kirito  commented on March 1, 2017, 3:24 p.m.

      You forgot about X.


    • -10
      iNfaM0usRack3t  commented on Jan. 1, 2017, 10:29 p.m.
      Memory

      More memory for racket please.


      • -13
        Kirito  commented on Jan. 2, 2017, 9:48 a.m.

        Memory limit has been raised to 64 MB for all languages.


        • 4
          loltrollkill  commented on Aug. 6, 2018, 7:14 p.m.

          What is up with the haters?!


          • 1
            xxsc  commented on Aug. 17, 2018, 8:51 p.m.

            Like seriously!


    • -4
      BMP  commented on Jan. 7, 2015, 5:03 p.m.
      Java regex!

      One line of code :P


    • -3
      msa789  commented on Nov. 14, 2014, 4:17 p.m.
      Is 5 part of the output in the second sample?

      is it?


      • -3
        FatalEagle  commented on Nov. 14, 2014, 5:31 p.m.

        No, it is a error and has been fixed.