SPOJ Problem Set (classical)

3378. Mirrored Pairs

Problem code: MIRRORED

The letters b and d are mirror images of each other, as are p and q. No other pairs of letters are mirrors, except for letters like H that are mirrors of themselves, and what’s the interest in a pair that’s just two of the same letter? We refuse to count self-mirrors as mirrored pairs.

Input

Input is a list of lines with two characters on each line. Your program should end immediately when it encounters a line with two spaces.

Output

The first line of output should contain only Ready. For each pair of characters (prior to a pair of spaces), print the line Mirrored pair if the characters are mirrors, otherwise print the line Ordinary pair.

Example

Input:
Fr
qp
HH
db
  
pq

Output:
Ready
Ordinary pair
Mirrored pair
Ordinary pair
Mirrored pair

All Submissions
Best Solutions


Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Apr 08, 2011

Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3

Comments (Search)

<
1
2
>

How can this simple program take too long to evaluate? Only one of the test cases though. Can someone help me with this?

There's an end condition that you're not considering. Hint: you probably won't be able to test this via console.

Isnt the end condition two spaces in a line?

Sorry about that. Again, I guess I didn't look at your code carefully enough.

This was a problem on our end. I fixed it and rejudged, and you're now getting AC. :-)

Thanks for your fast help! :)

can this be considered a mirror input:
_bd_
or
b_db_d
?

There are only two characters per line.

I tried it many times but still get 0/100. .

You're not checking for every single possibility that causes a mirrored pair.

what do you mean by characters... does it include only alphabets and numbers or the entire ascii table?

You will not have to process non-alphabetic characters.

There is not supposed to be a a pq at the end of the sample input

Not a mistake.

Read the input format carefully:
Input is a list of lines with two characters on each line. Your program should end immediately when it encounters a line with two spaces.


Nowhere does it guarantee that there will be nothing after the line with two spaces.


You're being careless with the output format.

Look closely at your output and their output...it's very easy to spot actually.

That's now four programs wrong because of error in spelling in output! So careless!!!!!!!!!

Maybe you should debug your program and check your spelling & Grammer before you ask for help on forums.

Still, at school too, on math tests, every question I get wrong is because of careless mistakes.