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-the-count-of-numbers-which-are-not-special].html
2024-08-06 08:46:50 +08:00

45 lines
1.5 KiB
HTML
Raw Permalink 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>给你两个<strong> 正整数 </strong><code>l</code><code>r</code>。对于任何数字 <code>x</code><code>x</code> 的所有正因数(除了 <code>x</code> 本身)被称为 <code>x</code><strong>真因数</strong></p>
<p><span class="text-only" data-eleid="13" style="white-space: pre;">如果一个数字恰好仅有两个</span> <strong>真因数</strong>,则称该数字为 <strong>特殊数字</strong>。例如:</p>
<ul>
<li>数字 4 是<strong> 特殊数字</strong>,因为它的真因数为 1 和 2。</li>
<li>数字 6 不是 <strong>特殊数字</strong>,因为它的真因数为 1、2 和 3。</li>
</ul>
<p>返回区间 <code>[l, r]</code><strong> 不是 特殊数字 </strong>的数字数量。</p>
<p>&nbsp;</p>
<p><strong class="example">示例 1</strong></p>
<div class="example-block">
<p><strong>输入:</strong> <span class="example-io">l = 5, r = 7</span></p>
<p><strong>输出:</strong> <span class="example-io">3</span></p>
<p><strong>解释:</strong></p>
<p>区间 <code>[5, 7]</code> 内不存在特殊数字。</p>
</div>
<p><strong class="example">示例 2</strong></p>
<div class="example-block">
<p><strong>输入:</strong> <span class="example-io">l = 4, r = 16</span></p>
<p><strong>输出:</strong> <span class="reset-io">11</span></p>
<p><strong>解释:</strong></p>
<p>区间 <code>[4, 16]</code> 内的特殊数字为 4 和 9。</p>
</div>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= l &lt;= r &lt;= 10<sup>9</sup></code></li>
</ul>