mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-12-19 10:34:57 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个 <code>m x n</code> 的二进制矩阵 <code>grid</code> ,每个格子要么为 <code>0</code> (空)要么为 <code>1</code> (被占据)。</p>\n\n<p>给你邮票的尺寸为 <code>stampHeight x stampWidth</code> 。我们想将邮票贴进二进制矩阵中,且满足以下 <strong>限制</strong> 和 <strong>要求</strong> :</p>\n\n<ol>\n\t<li>覆盖所有 <strong>空</strong> 格子。</li>\n\t<li>不覆盖任何 <strong>被占据 </strong>的格子。</li>\n\t<li>我们可以放入任意数目的邮票。</li>\n\t<li>邮票可以相互有 <strong>重叠</strong> 部分。</li>\n\t<li>邮票不允许 <strong>旋转</strong> 。</li>\n\t<li>邮票必须完全在矩阵 <strong>内</strong> 。</li>\n</ol>\n\n<p>如果在满足上述要求的前提下,可以放入邮票,请返回 <code>true</code> ,否则返回<i> </i><code>false</code> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode.com/uploads/2021/11/03/ex1.png\" style=\"width: 180px; height: 237px;\"></p>\n\n<pre><b>输入:</b>grid = [[1,0,0,0],[1,0,0,0],[1,0,0,0],[1,0,0,0],[1,0,0,0]], stampHeight = 4, stampWidth = 3\n<b>输出:</b>true\n<b>解释:</b>我们放入两个有重叠部分的邮票(图中标号为 1 和 2),它们能覆盖所有与空格子。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode.com/uploads/2021/11/03/ex2.png\" style=\"width: 170px; height: 179px;\"></p>\n\n<pre><b>输入:</b>grid = [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]], stampHeight = 2, stampWidth = 2 \n<b>输出:</b>false \n<b>解释:</b>没办法放入邮票覆盖所有的空格子,且邮票不超出网格图以外。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>m == grid.length</code></li>\n\t<li><code>n == grid[r].length</code></li>\n\t<li><code>1 <= m, n <= 10<sup>5</sup></code></li>\n\t<li><code>1 <= m * n <= 2 * 10<sup>5</sup></code></li>\n\t<li><code>grid[r][c]</code> 要么是 <code>0</code> ,要么是 <code>1</code> 。</li>\n\t<li><code>1 <= stampHeight, stampWidth <= 10<sup>5</sup></code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 29,
|
||||
"likes": 32,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -155,7 +155,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"1.7K\", \"totalSubmission\": \"7K\", \"totalAcceptedRaw\": 1744, \"totalSubmissionRaw\": 6971, \"acRate\": \"25.0%\"}",
|
||||
"stats": "{\"totalAccepted\": \"1.8K\", \"totalSubmission\": \"7.2K\", \"totalAcceptedRaw\": 1822, \"totalSubmissionRaw\": 7208, \"acRate\": \"25.3%\"}",
|
||||
"hints": [
|
||||
"We can check if every empty cell is a part of a consecutive row of empty cells that has a width of at least stampWidth as well as a consecutive column of empty cells that has a height of at least stampHeight.",
|
||||
"We can prove that this condition is sufficient and necessary to fit the stamps while following the given restrictions and requirements.",
|
||||
|
||||
Reference in New Issue
Block a user