1 Star 41 Fork 18

小墨/力扣题库(完整版)

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
丑数 III [ugly-number-iii].html 1.30 KB
Copy Edit Raw Blame History
小墨 authored 2025-01-09 20:29 +08:00 . 批量更新数据
<p>丑数是可以被&nbsp;<code>a</code>&nbsp;<strong></strong>&nbsp;<code>b</code>&nbsp;<strong></strong> <code>c</code>&nbsp;整除的 <strong>正整数</strong></p>
<p>给你四个整数:<code>n</code><code>a</code><code>b</code><code>c</code> ,请你设计一个算法来找出第&nbsp;<code>n</code>&nbsp;个丑数。</p>
<p>&nbsp;</p>
<p><strong>示例 1:</strong></p>
<pre>
<strong>输入:</strong>n = 3, a = 2, b = 3, c = 5
<strong>输出:</strong>4
<strong>解释:</strong>丑数序列为 2, 3, 4, 5, 6, 8, 9, 10... 其中第 3 个是 4。</pre>
<p><strong>示例 2:</strong></p>
<pre>
<strong>输入:</strong>n = 4, a = 2, b = 3, c = 4
<strong>输出:</strong>6
<strong>解释:</strong>丑数序列为 2, 3, 4, 6, 8, 9, 10, 12... 其中第 4 个是 6。
</pre>
<p><strong>示例 3:</strong></p>
<pre>
<strong>输入:</strong>n = 5, a = 2, b = 11, c = 13
<strong>输出:</strong>10
<strong>解释:</strong>丑数序列为 2, 4, 6, 8, 10, 11, 12, 13... 其中第 5 个是 10。
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= n, a, b, c &lt;= 10<sup>9</sup></code></li>
<li><code>1 &lt;= a * b * c &lt;= 10<sup>18</sup></code></li>
<li>本题结果在&nbsp;<code>[1,&nbsp;2 * 10<sup>9</sup>]</code>&nbsp;的范围内</li>
</ul>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/coder-xiaomo/leetcode-problemset.git
git@gitee.com:coder-xiaomo/leetcode-problemset.git
coder-xiaomo
leetcode-problemset
力扣题库(完整版)
master

Search