mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 15:31:43 +08:00
存量题库数据更新
This commit is contained in:
@@ -1,32 +1,34 @@
|
||||
<p>在一个二维的花园中,有一些用 (x, y) 坐标表示的树。由于安装费用十分昂贵,你的任务是先用<strong>最短</strong>的绳子围起所有的树。只有当所有的树都被绳子包围时,花园才能围好栅栏。你需要找到正好位于栅栏边界上的树的坐标。</p>
|
||||
|
||||
|
||||
|
||||
<p> </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>你被要求用最短长度的绳子把整个花园围起来,因为绳子很贵。只有把 <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> </p>
|
||||
|
||||
<p><strong>注意:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>1 <= points.length <= 3000</code></li>
|
||||
<li><code>points[i].length == 2</code></li>
|
||||
<li><code>0 <= x<sub>i</sub>, y<sub>i</sub> <= 100</code></li>
|
||||
<li>
|
||||
<p data-group="1-1">所有给定的点都是 <strong>唯一 </strong>的。</p>
|
||||
</li>
|
||||
</ul>
|
||||
|
Reference in New Issue
Block a user