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)/找到和为给定整数的三个连续整数 [find-three-consecutive-integers-that-sum-to-a-given-number].html
2022-03-29 12:43:11 +08:00

27 lines
832 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>&nbsp;,请你返回三个连续的整数,它们的&nbsp;<strong></strong>&nbsp;<em>&nbsp;</em><code>num</code>&nbsp;。如果&nbsp;<code>num</code>&nbsp;无法被表示成三个连续整数的和,请你返回一个 <strong></strong>&nbsp;数组。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre><b>输入:</b>num = 33
<b>输出:</b>[10,11,12]
<b>解释:</b>33 可以表示为 10 + 11 + 12 = 33 。
10, 11, 12 是 3 个连续整数,所以返回 [10, 11, 12] 。
</pre>
<p><strong>示例 2</strong></p>
<pre><b>输入:</b>num = 4
<b>输出:</b>[]
<b>解释:</b>没有办法将 4 表示成 3 个连续整数的和。
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>0 &lt;= num &lt;= 10<sup>15</sup></code></li>
</ul>