1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-25 14:58:56 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>给你一个二进制矩阵 <code>matrix</code> ,它的大小为 <code>m x n</code> ,你可以将 <code>matrix</code> 中的 <strong>列</strong> 按任意顺序重新排列。</p>\n\n<p>请你返回最优方案下将 <code>matrix</code> 重新排列后,全是 <code>1</code> 的子矩阵面积。</p>\n\n<p> </p>\n\n<p><strong>示例 1</strong></p>\n\n<p><strong><img alt=\"\" src=\"https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2021/01/17/screenshot-2020-12-30-at-40536-pm.png\" style=\"width: 300px; height: 144px;\" /></strong></p>\n\n<pre>\n<b>输入:</b>matrix = [[0,0,1],[1,1,1],[1,0,1]]\n<b>输出:</b>4\n<b>解释:</b>你可以按照上图方式重新排列矩阵的每一列。\n最大的全 1 子矩阵是上图中加粗的部分,面积为 4 。\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2021/01/17/screenshot-2020-12-30-at-40852-pm.png\" style=\"width: 500px; height: 62px;\" /></p>\n\n<pre>\n<b>输入:</b>matrix = [[1,0,1,0,1]]\n<b>输出:</b>3\n<b>解释:</b>你可以按照上图方式重新排列矩阵的每一列。\n最大的全 1 子矩阵是上图中加粗的部分,面积为 3 。\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre>\n<b>输入:</b>matrix = [[1,1,0],[1,0,1]]\n<b>输出:</b>2\n<b>解释:</b>由于你只能整列整列重新排布,所以没有比面积为 2 更大的全 1 子矩形。</pre>\n\n<p><strong>示例 4</strong></p>\n\n<pre>\n<b>输入:</b>matrix = [[0,0],[0,0]]\n<b>输出:</b>0\n<b>解释:</b>由于矩阵中没有 1 ,没有任何全 1 的子矩阵,所以面积为 0 。</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>m == matrix.length</code></li>\n\t<li><code>n == matrix[i].length</code></li>\n\t<li><code>1 <= m * n <= 10<sup>5</sup></code></li>\n\t<li><code>matrix[i][j]</code> 要么是 <code>0</code> ,要么是 <code>1</code> 。</li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 45,
"likes": 46,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -155,7 +155,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"3.7K\", \"totalSubmission\": \"6.5K\", \"totalAcceptedRaw\": 3736, \"totalSubmissionRaw\": 6469, \"acRate\": \"57.8%\"}",
"stats": "{\"totalAccepted\": \"3.8K\", \"totalSubmission\": \"6.6K\", \"totalAcceptedRaw\": 3816, \"totalSubmissionRaw\": 6585, \"acRate\": \"57.9%\"}",
"hints": [
"For each column, find the number of consecutive ones ending at each position.",
"For each row, sort the cumulative ones in non-increasing order and \"fit\" the largest submatrix."