Problem
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area.Idea
已被折磨疯了,给两个链接参考http://www.xiaoyingedu.com/report?pid=74
http://www.cnblogs.com/TenosDoIt/p/3454877.html
思路是先用dp解出每一行最长连续点的数量,然后基于这个结果用O(n^3)的方法解,从(i,j)出发每个小矩形的面积
No comments:
Post a Comment