Largest Submatrix
题目描述
Now here is a matrix with letter 'a','b','c','w','x','y','z' and you can change 'w' to 'a' or 'b', change 'x' to 'b' or 'c', change 'y' to 'a' or 'c', and change 'z' to 'a', 'b' or 'c'. After you changed it, what's the largest submatrix with the same letters you can make?
输入格式
The input contains multiple test cases. Each test case begins with $m$ and $n (1 <m,n
输出格式
For each test case, output one line containing the number of elements of the largest submatrix of all same letters.
2 4
abcw
wxyz
3
提示
(暂无提示)
标签: P10965|动态规划 DP|O2优化|单调栈
来源
P10965|Largest Submatrix