1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/最接近的因数 [closest-divisors].html
2022-03-29 12:43:11 +08:00

38 lines
983 B
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>num</code>,请你找出同时满足下面全部要求的两个整数:</p>
<ul>
<li>两数乘积等于 &nbsp;<code>num + 1</code>&nbsp;&nbsp;<code>num + 2</code></li>
<li>以绝对差进行度量,两数大小最接近</li>
</ul>
<p>你可以按任意顺序返回这两个整数。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre><strong>输入:</strong>num = 8
<strong>输出:</strong>[3,3]
<strong>解释:</strong>对于 num + 1 = 9最接近的两个因数是 3 &amp; 3对于 num + 2 = 10, 最接近的两个因数是 2 &amp; 5因此返回 3 &amp; 3 。
</pre>
<p><strong>示例 2</strong></p>
<pre><strong>输入:</strong>num = 123
<strong>输出:</strong>[5,25]
</pre>
<p><strong>示例 3</strong></p>
<pre><strong>输入:</strong>num = 999
<strong>输出:</strong>[40,25]
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= num &lt;= 10^9</code></li>
</ul>