mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
38 lines
1.4 KiB
HTML
38 lines
1.4 KiB
HTML
<p>给定三个整数 <code>x</code> 、 <code>y</code> 和<em> </em><code>bound</code><em> </em>,返回 <em>值小于或等于 <code>bound</code> 的所有 <strong>强整数</strong> 组成的列表</em> 。</p>
|
||
|
||
<p>如果某一整数可以表示为 <code>x<sup>i</sup> + y<sup>j</sup></code> ,其中整数 <code>i >= 0</code> 且 <code>j >= 0</code>,那么我们认为该整数是一个 <strong>强整数</strong> 。</p>
|
||
|
||
<p>你可以按 <strong>任何顺序</strong> 返回答案。在你的回答中,每个值 <strong>最多</strong> 出现一次。</p>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>示例 1:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>x = 2, y = 3, bound = 10
|
||
<strong>输出:</strong>[2,3,4,5,7,9,10]
|
||
<strong>解释: </strong>
|
||
2 = 2<sup>0</sup> + 3<sup>0</sup>
|
||
3 = 2<sup>1</sup> + 3<sup>0</sup>
|
||
4 = 2<sup>0</sup> + 3<sup>1</sup>
|
||
5 = 2<sup>1</sup> + 3<sup>1</sup>
|
||
7 = 2<sup>2</sup> + 3<sup>1</sup>
|
||
9 = 2<sup>3</sup> + 3<sup>0</sup>
|
||
10 = 2<sup>0</sup> + 3<sup>2</sup></pre>
|
||
|
||
<p><strong>示例 2:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>x = 3, y = 5, bound = 15
|
||
<strong>输出:</strong>[2,4,6,8,10,14]
|
||
</pre>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>提示:</strong></p>
|
||
|
||
<ul>
|
||
<li><code>1 <= x, y <= 100</code></li>
|
||
<li><code>0 <= bound <= 10<sup>6</sup></code></li>
|
||
</ul>
|