Biggest submatrix - MarisaOJ: Marisa Online Judge

Biggest submatrix

Time limit: 1000 ms
Memory limit: 256 MB
Given a binary matrix with $n$ rows and $m$ columns. Find the maximum area submatrix with at most $k$ number $1$. ### Input - The first line contains three integers $n, m,k$. - The next $n$ lines, each line contains a binary string of length $n$. ### Output - Print the area of the largest submatrix with at most $k$ number $1$. ### Constraints - $1 \le n, m \le 500$. - $1 \le k \le n \times m $. ### Example Input: ``` 3 3 2 100 100 001 ``` Output: ``` 6 ```