DWITE '09 R5 #4 - Kind of like OCR

View as PDF

Submit solution

Points: 7
Time limit: 1.0s
Memory limit: 64M

Problem types
DWITE Online Computer Programming Contest, March 2010, Problem 4

Optical Character Recognition (OCR) is the process of extracting textual information from images. While the current technology is mostly software based, rather than using optical devices, the term has stuck around.

For the problem we'll work with a very simple alphabet, each letter strictly defined by a 2 \times 2 or 3 \times 2 bitmap.

A - x.
    xx

B - xx
    xx

C - x.x
    xxx

D - xx
    .x

E - xxx
    .xx

The input will contain 5 sets, each 2 lines long, at least 2 and no longer than 30 characters long. A set will spell out some word in the above alphabet. It will always be a valid word, and it will not be ambiguous (in a way that only one possible word could make the design pattern).

The output will contain 5 lines of output — the recognized words.

Note: you would need to take a word as a whole to distinguish between some of the cases. For example: in the below sample, while the first character could be read as C, the rest of the word would not be made of valid characters.

Sample Input

x.x.x
xxxxx
x.x.xx
xxxxxx

Sample Output

AC
AAB

Problem Resource: DWITE

Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported

Comments

There are no comments at the moment.