CCC '13 J2 - Rotating letters

View as PDF

Submit solution

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

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


  • -1
    studentcsaa7  commented on Dec. 15, 2024, 8:57 p.m.

    I am stuckkkk helppp :(


  • -3
    35p problems are really easy when you cheat  commented on Nov. 24, 2023, 12:03 a.m. edited

    hooray did it with one line Edit: one line also possible in javascript


    • 1
      R_G  commented on July 14, 2024, 3:36 p.m.

      bro i did it in 25 😭😭😭😭😭😭


  • -12
    emanresu  commented on March 24, 2022, 8:44 p.m.

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


    • -2
      tappbros  commented on March 24, 2022, 11:49 p.m.

      Brute forcing. That's how.


  • 101
    Raymo111  commented on Aug. 7, 2018, 1:34 p.m.

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


    • -25
      960t  commented on Sept. 22, 2022, 2:12 p.m.

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


    • 19
      charliezhao06  commented on Oct. 31, 2020, 11:29 p.m.

      Is is valid, and isn't isn't valid also.


      • 11
        kevinyang  commented on Nov. 1, 2020, 12:21 a.m.

        Water is wet


        • -13
          leoxu821  commented on Feb. 26, 2021, 1:38 a.m.

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


  • -80
    omaewamoushindeiru  commented on Jan. 7, 2015, 10:03 p.m.

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


    • 0
      emanresu  commented on March 24, 2022, 8:23 p.m.

      um how


      • 1
        John  commented on March 25, 2022, 11:47 p.m.

        I got two lines with C++, don't know if it's possible in one