BOB GamingProblem code: KC201 |
All submissions for this problem are available.
Points:10
Very long ago a group of scholars formed a secret society by the name of Brotherhood of Brom. They went underground so that they could continue their scientific research away from the eyes of the church that demanded confinement of all scientific pursuits, for the church saw them as acts of devilry brought upon by curiosity. Scientists were often rounded up in the name of being evil witches and wizards and burnt at the stake...or sometimes killed by the church assassins. To maintain their secrecy, the Brotherhood of Brom used passwords. However they did not sick to a single password, instead they used mirrored palindromes. The more the number of such words a member could come up with, the more intelligent he seemed to be...
A regular palindrome is a string of numbers or letters that is the same forward as backward. For example, the string "ABCDEDCBA" is a palindrome because it is the same when the string is read from left to right as when the string is read from right to left. A mirrored string is a string for which when each of the elements of the string is changed to its reverse (if it has a reverse) and the string is read backwards the result is the same as the original string. For example, the string "3AIAE" is a mirrored string because "A" and "I" are their own reverses, and "3" and "E" are each others' reverses.
A mirrored palindrome is a string that meets the criteria of a regular palindrome and the criteria of a mirrored string. The string "ATOYOTA" is a mirrored palindrome because if the string is read backwards, the string is the same as the original and because if each of the characters is replaced by its reverse and the result is read backwards, the result is the same as the original string. Of course, "A", "T", "O", and "Y" are all their own reverses.
A list of all valid characters and their reverses is as follows.Char Rev Char Rev Char Reverse A A M M Y Y B N Z 5 C O O 1 1 D P 2 S E 3 Q 3 E F R 4 G S 2 5 Z H H T T 6 I I U U 7 J L V V 8 8 K W W 9 L J X X
*Note* that O (zero) and 0 (the letter) are considered the same characterand therefore *ONLY* the letter "0" is a valid character.
It turns out that your great great great great grandfather was a member of this society. Wishing to emulate their genius, you want to use the same passwords for your lan gaming events in the modern day. You must design a program that checks whether a given string can act as password or not.
Input:
Input consists of strings (one per line) each of which will consist valid characters(<100). There will be no invalid characters in any of the strings. Last line contains # represents end of inputs.
Output:
Output will be a string: "notpalindrome" --if the string is not a palindrome and is not a mirrored string "regularpalindrome"-- if the string is a palindrome and is not a mirrored string "mirroredstring" --if the string is not a palindrome and is a mirrored string "mirroredpalindrome"-- if the string is a palindrome and is a mirrored string
Example:
Input:NOTAPALINDROME ISAPALINILAPASI 2A3MEAS ATOYOTA #Output:
notpalindrome regularpalindrome mirroredstring mirroredpalindrome
| Author: | ankitbabbar |
| Date Added: | 16-10-2009 |
| Time Limit: | 5 sec |
| Source Limit: | 50000 Bytes |
| Languages: | ADA, ASM, BASH, BF, C, C99 strict, CAML, CLOJ, CLPS, CPP 4.0.0-8, CPP 4.3.2, CS2, D, F#, FORT, GO, HASK, ICK, ICON, JAR, JAVA, JS, LISP clisp, LISP sbcl, LUA, NEM, NICE, PAS fpc, PAS gpc, PERL, PERL6, PHP, PIKE, PRLG, PYTH, PYTH 3.1.2, RUBY, SCALA, SCM guile, SCM qobi, ST, TEXT, WSPC |
Comments

Fetching successful submissions

There is no reverse for
There is no reverse for character K.
W is the reverse for W.
are there any more test
are there any more test cases...??
my code is giving correct output for all inputs but all I'm getting in wrong answer
Are 9 and P mirrors?
Are 9 and P mirrors?
No 9 and P are not ....since
No 9 and P are not ....since not in the mentioned valid characters..
where d hell from do the
where d hell from do the compile time errors arise when i am not getting any in dex c++
@Abhinav: You can click on
@Abhinav: You can click on the compiler error button ...and you can come to know what is the error coming here and not on your compiler..
LOWER CASES TO BE CONSIDERED?
LOWER CASES TO BE CONSIDERED?
No,Only the mentioned
No,Only the mentioned characters...
is K's reverse is and W??
is K's reverse is and W??
No there is no reverse for
No there is no reverse for K..
ADMIN PLEASE CLEAR IS K IS
ADMIN PLEASE CLEAR IS K IS THE MIRROR OF W OR NOT AND ALSO P AND 9 ARE MIRROR OR NOT ?
plz ny1 give me the working
plz ny1 give me the working source code in c/c++