Character Recognition


  • 1
    L

    ###Description

    • Character recognition is the conversion of images into text. For now we consider each character in the picture is a NM matrix with only zeros and ones, and we need to recognize K characters. You are to write a program to find minimal number of pixels so that we can recognize each character.
      For example, we have only two characters 'T' and 'L', and the matrix size is 3
      3, we can think 'T' and 'L' are 111 100 010 100 010 111 so we can recognize the character with only bottom-left pixel, the answer is 1.

    ###Limits

    • -Memory limit per test: 256 megabytes
    • -Time limit per test: The faster the better

    ###Compile & Environment

    • C++
    • g++ Main.cc -o Main -fno-asm -Wall -lm --static -std=c++0x -DONLINE_JUDGE Java
    • J2SE 8
      Maximum stack size is 50m

    Input

    • The first line of input is three integers N, M, K (1 <= N, M <= 10, 2 <= K <= 6). Which represents the size of matrix and number of characters. Then is following K blocks, which represents the matrix. Notice that each block starts with a blank line.

    ###Output

    • You should output the minimum number of pixels, which is the answer.

    ###Sample Test

    Input

    2 3 2


    111
    010


    100
    100

    ####output

    1


  • 0
    X
    This post is deleted!

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.