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)/分割圆的最少切割次数 [minimum-cuts-to-divide-a-circle].html
2022-12-04 20:08:50 +08:00

47 lines
1.5 KiB
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>圆内一个 <strong>有效切割</strong>&nbsp;,符合以下二者之一:</p>
<ul>
<li>该切割是两个端点在圆上的线段,且该线段经过圆心。</li>
<li>该切割是一端在圆心另一端在圆上的线段。</li>
</ul>
<p>一些有效和无效的切割如下图所示。</p>
<p><img alt="" src="https://assets.leetcode.com/uploads/2022/10/29/alldrawio.png" style="width: 450px; height: 174px;" /></p>
<p>给你一个整数&nbsp;<code>n</code>&nbsp;,请你返回将圆切割成相等的&nbsp;<code>n</code>&nbsp;等分的&nbsp;<strong>最少</strong>&nbsp;切割次数。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<p><img alt="" src="https://assets.leetcode.com/uploads/2022/10/24/11drawio.png" style="width: 200px; height: 200px;" /></p>
<pre>
<b>输入:</b>n = 4
<b>输出:</b>2
<b>解释:</b>
上图展示了切割圆 2 次,得到四等分。
</pre>
<p><strong>示例 2</strong></p>
<p><img alt="" src="https://assets.leetcode.com/uploads/2022/10/24/22drawio.png" style="width: 200px; height: 201px;" /></p>
<pre>
<b>输入:</b>n = 3
<b>输出:</b>3
<strong>解释:</strong>
最少需要切割 3 次,将圆切成三等分。
少于 3 次切割无法将圆切成大小相等面积相同的 3 等分。
同时可以观察到,第一次切割无法将圆切割开。
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= n &lt;= 100</code></li>
</ul>