1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 19:18:14 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/强整数 [powerful-integers].html

38 lines
1.4 KiB
HTML
Raw Normal View History

2022-03-27 20:46:41 +08:00
<p>给定三个整数 <code>x</code>&nbsp;&nbsp;<code>y</code>&nbsp;<em>&nbsp;</em><code>bound</code><em>&nbsp;</em>,返回 <em>值小于或等于&nbsp;<code>bound</code>&nbsp;的所有&nbsp;<strong>强整数</strong>&nbsp;组成的列表</em>&nbsp;</p>
<p>如果某一整数可以表示为&nbsp;<code>x<sup>i</sup>&nbsp;+ y<sup>j</sup></code>&nbsp;,其中整数&nbsp;<code>i &gt;= 0</code>&nbsp;<code>j &gt;= 0</code>,那么我们认为该整数是一个&nbsp;<strong>强整数</strong>&nbsp;</p>
<p>你可以按 <strong>任何顺序</strong> 返回答案。在你的回答中,每个值 <strong>最多</strong> 出现一次。</p>
<p>&nbsp;</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>示例&nbsp;2</strong></p>
<pre>
<strong>输入:</strong>x = 3, y = 5, bound = 15
<strong>输出:</strong>[2,4,6,8,10,14]
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= x, y &lt;= 100</code></li>
<li><code>0 &lt;= bound &lt;= 10<sup>6</sup></code></li>
</ul>