#Lutece0386. Largest Submatrix of All 1’s
Largest Submatrix of All 1’s
Migrated from Lutece 386 Largest Submatrix of All 1’s
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Given a -by- -matrix, of all its submatrixes of all ’s which is the largest? By largest we mean that the submatrix has the most elements.
Input
The input contains multiple test cases. Each test case begins with and () on line. Then come the elements of a -matrix in row-major order on lines each with numbers. The input ends once EOF is met.
Output
For each test case, output one line containing the number of elements of the largest submatrix of all ’s. If the given matrix is of all ’s, output .
Samples
2 2
0 0
0 0
4 4
0 0 0 0
0 1 1 0
0 1 1 0
0 0 0 0
0
4
Note
The data used in this problem is unofficial data prepared by pfctgeorge. So any mistake here does not imply mistake in the offcial judge data.
Resources
POJ Founder Monthly Contest – 2008.01.31