1768 - [Ceoi2009]logs

有一个N*M的01矩阵,现在你可以的任意交换其中的列,要求找一个最大的仅由1组成的矩阵。 N<=15000,M<=1500 1 ≤ N ≤ 15000 1 ≤ M ≤ 1500 30% of the test cases will have N,M ≤ 1024

输入

N,M 以下N行每行M个字符。

输出

样例

输入

10 6 
001010 
111110 
011110 
111110 
011110 
111111 
110111 
110111 
000101 
010101 

输出

21

提示

By permuting the columns such that columns 2, 4 and 5 are adjacent you have a rectangle of area 21 (rows 2-8 and columns 2, 4, 5).

时间限制 1 秒
内存限制 128 MB
讨论 统计
上一题 下一题