Pro.ID10207 TitleCharacter Recognition Title链接http://10.20.2.8/oj/exercise/problem?problem_id=10207 AC0 Submit0 Ratio- 时间&空间限制描述This problem requires you to write a program that performs character recognition. Each ideal character image has 20 lines of 20 digits. Each digit is a '0' or a '1'. See Figure 1a (way below) for the layout of character images in the file. The file font.in contains representations of 27 ideal character images in this order: _abcdefghijklmnopqrstuvwxyz where _ represents the space character. Each ideal character is 20 lines long. The input file contains one or more potentially corrupted character images. A character image might be corrupted in these ways:
No character image will have both a duplicated line and a missing line. No more than 30% of the 0's and 1's will be changed in any character image in the evaluation datasets. In the case of a duplicated line, one or both of the resulting lines may have corruptions, and the corruptions may be different. Write a program to recognize the sequence of one or more characters in the image provided in the input file using the font provided in file font.in. Recognize a character image by choosing the font character images that require the smallest number of overall changed 1's and 0's to be corrupted to the given font image, given the most favourable assumptions about duplicated or omitted lines. Count corruptions in only the least corrupted line in the case of a duplicated line. You must determine the sequence of characters that most closely matches the input sequence (the one that requires the least number of corruptions). There is a unique best solution for each evaluation dataset. A correct solution will use precisely all of the data supplied in the input file. 输入Both input files begin with an integer N (19 <= N < 1200) that specifies the number of lines that follow: N(digit1)(digit2)(digit3) ... (digit20) (digit1)(digit2)(digit3) ... (digit20) ... Each line of data is 20 digits wide. There are no spaces separating the zeros and ones. The file font.in describes the font. It will always contain 541 lines. It may differ for each evaluation dataset. 输出Description This problem requires you to write a program that performs character recognition. Each ideal character image has 20 lines of 20 digits. Each digit is a '0' or a '1'. See Figure 1a (way below) for the layout of character images in the file. The file font.in contains representations of 27 ideal character images in this order: _abcdefghijklmnopqrstuvwxyz where _ represents the space character. Each ideal character is 20 lines long. The input file contains one or more potentially corrupted character images. A character image might be corrupted in these ways:
No character image will have both a duplicated line and a missing line. No more than 30% of the 0's and 1's will be changed in any character image in the evaluation datasets. In the case of a duplicated line, one or both of the resulting lines may have corruptions, and the corruptions may be different. Write a program to recognize the sequence of one or more characters in the image provided in the input file using the font provided in file font.in. Recognize a character image by choosing the font character images that require the smallest number of overall changed 1's and 0's to be corrupted to the given font image, given the most favourable assumptions about duplicated or omitted lines. Count corruptions in only the least corrupted line in the case of a duplicated line. You must determine the sequence of characters that most closely matches the input sequence (the one that requires the least number of corruptions). There is a unique best solution for each evaluation dataset. A correct solution will use precisely all of the data supplied in the input file. Input Both input files begin with an integer N (19 <= N < 1200) that specifies the number of lines that follow: N(digit1)(digit2)(digit3) ... (digit20) (digit1)(digit2)(digit3) ... (digit20) ... Each line of data is 20 digits wide. There are no spaces separating the zeros and ones. The file font.in describes the font. It will always contain 541 lines. It may differ for each evaluation dataset. Output Your program must produce an output file that contains a single string of the characters recognized. Its format is a single line of ASCII text. The output should not contain any separator characters. If your program does not recognize a particular character, it must output a ? in the appropriate position.Sample Input
Sample Output a Note that the output is a line with two characters: a blank followed by an 'a'.Hint 请无视本题。 因为需要读入一个文件,暂时无法实现。 Source 样例输入
样例输出 a Note that the output is a line with two characters: a blank followed by an 'a'.提示请无视本题。 因为需要读入一个文件,暂时无法实现。 |