CCC '13 J2 - Rotating letters

View as PDF

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

Problem type
Allowed languages
Ada, Assembly, Awk, Brain****, C, C#, C++, COBOL, CommonLisp, D, Dart, F#, Forth, Fortran, Go, Groovy, Haskell, Intercal, Java, JS, Kotlin, Lisp, Lua, Nim, ObjC, OCaml, Octave, Pascal, Perl, PHP, Pike, Prolog, Python, Racket, Ruby, Rust, Scala, Scheme, Sed, Swift, TCL, Text, Turing, VB, Zig
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

• commented on Oct. 30, 2020, 8:03 p.m. edit 2

• commented on Sept. 3, 2020, 12:40 p.m.

This comment is hidden due to too much negative feedback. Click here to view it.

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

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

• commented on Oct. 31, 2020, 7:29 p.m.

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

• commented on Oct. 31, 2020, 8:21 p.m.

Water is wet

• commented on Jan. 7, 2015, 5:03 p.m.

This comment is hidden due to too much negative feedback. Click here to view it.

• commented on Feb. 27, 2020, 1:44 p.m.

yes gamer