1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-05 15:31:43 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

存量题库数据更新

This commit is contained in:
2023-12-09 18:42:21 +08:00
parent a788808cd7
commit c198538f10
10843 changed files with 288489 additions and 248355 deletions

View File

@@ -1,32 +1,34 @@
<p>在一个二维的花园中,有一些用 (x, y) 坐标表示的树。由于安装费用十分昂贵,你的任务是先用<strong>最短</strong>的绳子围起所有的树。只有当所有的树都被绳子包围时,花园才能围好栅栏。你需要找到正好位于栅栏边界上的树的坐标</p>
<p>&nbsp;</p>
<p><strong>示例 1:</strong></p>
<pre><strong>:</strong> [[1,1],[2,2],[2,0],[2,4],[3,3],[4,2]]
<strong>输出:</strong> [[1,1],[2,0],[4,2],[3,3],[2,4]]
<strong>解释:</strong>
<img src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2018/10/12/erect_the_fence_1.png" style="width: 100%; max-width: 320px">
</pre>
<p><strong>示例 2:</strong></p>
<pre><strong>输入:</strong> [[1,2],[2,2],[4,2]]
<strong>输出:</strong> [[1,2],[2,2],[4,2]]
<p>给定一个数组 <code>trees</code>,其中 <code>trees[i] = [x<sub>i</sub>, y<sub>i</sub>]</code> 表示树在花园中的位置</p>
<p>你被要求用最短长度的绳子把整个花园围起来,因为绳子很贵。只有把&nbsp;<strong>所有的树都围起来</strong>,花园才围得很好。</p>
<p>返回<em>恰好位于围栏周边的树木的坐标</em></p>
<p><strong>示例 1:</strong></p>
<p><img src="https://assets.leetcode.com/uploads/2021/04/24/erect2-plane.jpg" style="width: 400px;" /></p>
<pre>
<strong>输入:</strong> points = [[1,1],[2,2],[2,0],[2,4],[3,3],[4,2]]
<strong>:</strong> [[1,1],[2,0],[3,3],[2,4],[4,2]]</pre>
<p><strong>示例 2:</strong></p>
<p><img src="https://assets.leetcode.com/uploads/2021/04/24/erect1-plane.jpg" style="height: 393px; width: 400px;" /></p>
<pre>
<strong>输入:</strong> points = [[1,2],[2,2],[4,2]]
<strong>输出:</strong> [[4,2],[2,2],[1,2]]</pre>
<p>&nbsp;</p>
<p><strong>注意:</strong></p>
<ul>
<li><code>1 &lt;= points.length &lt;= 3000</code></li>
<li><code>points[i].length == 2</code></li>
<li><code>0 &lt;= x<sub>i</sub>, y<sub>i</sub>&nbsp;&lt;= 100</code></li>
<li>
<p data-group="1-1">所有给定的点都是&nbsp;<strong>唯一&nbsp;</strong>的。</p>
</li>
</ul>