CodeChef is a non-commercial competitive programming community
Login
Username (New User? Signup) Password (Forgot Password?)
Signup
Login or
Signup with
Connect
Note
  • Publicize your achievements on your Facebook Wall.
  • Challenge your friends or ask them for help.

Site Navigation

  • PRACTICE
    • Easy
    • Medium
    • Hard
    • Challenge
    • Peer
  • COMPETE
    • All Contests
    • June Long 2012
    • May Cook-Off
    • May Long 2012
  • DISCUSS
    • Forums
    • Blog
    • Wiki
    • Facebook
    • Twitter
  • COMMUNITY
    • CodeChef Meetups
    • Campus Chapters
    • Host your Contest
    • User Groups
    • CodeChef TechTalks
    • All Educational Initiatives
  • HELP
    • Frequently Asked Questions
    • FAQ for problem setters
    • Problem Setting
    • Tutorials
    • Long Contest Ranks
    • Short Contest Ranks
    • Event Calendar
  • ABOUT
    • About CodeChef
    • Team CodeChef
    • Press Room
    • CodeChef Financials
    • CodeChef Sponsorships
    • CEO's Corner
    • Contact Us
    • About Directi
Home » Compete » Knight Coders Round 2 » BOB Gaming

BOB Gaming

Problem code: KC201

  • All Submissions

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


  • Submit

Comments

  • Login or Register to post a comment.

There is no reverse for

ankitbabbar @ 24 Oct 2009 09:06 PM

There is no reverse for character K.

W is the reverse for W.

are there any more test

sushantrocks @ 24 Oct 2009 10:56 PM

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?

muditjain87 @ 24 Oct 2009 11:05 PM

Are 9 and P mirrors?

No 9 and P are not ....since

ankitbabbar @ 24 Oct 2009 11:47 PM

No 9 and P are not ....since not in the mentioned valid characters..

where d hell from do the

abhi4all4ever @ 24 Oct 2009 11:53 PM

where d hell from do the compile time errors arise when i am not getting any in dex c++

@Abhinav: You can click on

ankitbabbar @ 24 Oct 2009 11:57 PM

@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?

sushantrocks @ 25 Oct 2009 12:38 AM

LOWER CASES TO BE CONSIDERED?

No,Only the mentioned

ankitbabbar @ 25 Oct 2009 12:40 AM

No,Only the mentioned characters...

is K's reverse is and W??

neel @ 25 Oct 2009 12:59 AM

is K's reverse is and W??

No there is no reverse for

ankitbabbar @ 25 Oct 2009 01:19 AM

No there is no reverse for K..

ADMIN PLEASE CLEAR IS K IS

avix @ 25 Oct 2009 11:50 AM

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

ankushedge @ 12 Jan 2010 09:47 AM

plz ny1 give me the working source code in c/c++

SUCCESSFUL SUBMISSIONS FOR THIS PROBLEM:

Programming Competition Fetching successful submissions
Directi Go for Gold
CodeChef is a global programming communityCodeChef hosts online programming competitions
CodeChef is a non-commercial competitive programming community
  • About CodeChef
  • About Directi
  • CEO's Corner
  • C-Programming
  • Programming Languages
  • Contact Us
© 2009 Directi Group. All Rights Reserved. CodeChef uses SPOJ © by Sphere Research Labs
In order to report copyright violations of any kind, send in an email to copyright@codechef.com
CodeChef a product of Directi
The time now is:
CodeChef - A Platform for Aspiring Programmers

CodeChef was created as a platform to help programmers make it big in the world of algorithms, computer programming and programming contests. At CodeChef we work hard to revive the geek in you by hosting a programming contest at the start of the month and another smaller programming challenge in the middle of the month. We also aim to have training sessions and discussions related to algorithms, binary search, technicalities like array size and the likes. Apart from providing a platform for programming competitions, CodeChef also has various algorithm tutorials and forum discussions to help those who are new to the world of computer programming.

Practice Section - A Place to hone your 'Computer Programming Skills'

Try your hand at one of our many practice problems and submit your solution in a language of your choice. Our programming contest judge accepts solutions in over 35+ programming languages. Preparing for coding contests were never this much fun! Receive points, and move up through the CodeChef ranks. Use our practice section to better prepare yourself for the multiple programming challenges that take place through-out the month on CodeChef.

Compete - Monthly Programming Contests and Cook-offs

Here is where you can show off your computer programming skills. Take part in our 10 day long monthly coding contest and the shorter format Cook-off coding contest. Put yourself up for recognition and win great prizes. Our programming contests have prizes worth up to Rs.20,000 and $700lots more CodeChef goodies up for grabs.

Discuss

Are you new to computer programming? Do you need help with algorithms? Then be a part of CodeChef's Forums and interact with all our programmers - they love helping out other programmers and sharing their ideas. Have discussions around binary search, array size, branch-and-bound, Dijkstra's algorithm, Encryption algorithm and more by visiting the CodeChef Forums and Wiki section.

CodeChef Community

As part of our Educational initiative, we give institutes the opportunity to associate with CodeChef in the form of Campus Chapters. Hosting online programming competitions is not the only feature on CodeChef. You can also host a coding contest for your institute on CodeChef, organize an algorithm event and be a guest author on our blog.

Go For Gold

The Go for Gold Initiative was launched about a year after CodeChef was incepted, to help prepare Indian students for the ACM ICPC World Finals competition. In the run up to the ACM ICPC competition, the Go for Gold initiative uses CodeChef as a platform to train students for the ACM ICPC competition via multiple warm up contests. As an added incentive the Go for Gold initiative is also offering over Rs.8 lacs to the Indian team that beats the 29th position at the ACM ICPC world finals. Find out more about the Go for Gold and the ACM ICPC competition here.

Domain Name Registration, Web hosting, and Website Design provided by BigRock.com