1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-03-14 16:22:24 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/铺瓷砖 [tiling-a-rectangle-with-the-fewest-squares].html

41 lines
1.3 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>给定一个大小为&nbsp;<code>n</code>&nbsp;x&nbsp;<code>m</code>&nbsp;的长方形,返回贴满矩形所需的整数边正方形的最小数量。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<p><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2019/10/25/sample_11_1592.png" style="height: 106px; width: 154px;" /></p>
<pre>
<strong>输入:</strong>n = 2, m = 3
<strong>输出:</strong>3
<code><strong>解释:</strong>需要<strong> </strong>3</code> 个正方形来覆盖长方形。
<code> 2</code><code>1x1 的正方形</code>
<code> 1</code><code>2x2 的正方形</code></pre>
<p><strong>示例 2</strong></p>
<p><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2019/10/25/sample_22_1592.png" style="height: 126px; width: 224px;" /></p>
<pre>
<strong>输入:</strong>n = 5, m = 8
<strong>输出:</strong>5
</pre>
<p><strong>示例 3</strong></p>
<p><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2019/10/25/sample_33_1592.png" style="height: 189px; width: 224px;" /></p>
<pre>
<strong>输入:</strong>n = 11, m = 13
<strong>输出:</strong>6
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= n, m &lt;= 13</code></li>
</ul>