mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
73 lines
3.1 KiB
HTML
73 lines
3.1 KiB
HTML
<p>给你两个正整数 <code>X</code> 和 <code>Y</code> 和一个二维整数数组 <code>circles</code> ,其中 <code>circles[i] = [x<sub>i</sub>, y<sub>i</sub>, r<sub>i</sub>]</code> 表示一个圆心在 <code>(x<sub>i</sub>, y<sub>i</sub>)</code> 半径为 <code>r<sub>i</sub></code> 的圆。</p>
|
||
|
||
<p>坐标平面内有一个左下角在原点,右上角在 <code>(X, Y)</code> 的矩形。你需要判断是否存在一条从左下角到右上角的路径满足:路径 <strong>完全</strong> 在矩形内部,<strong>不会</strong> 触碰或者经过 <strong>任何</strong> 圆的内部和边界,同时 <strong>只</strong> 在起点和终点接触到矩形。</p>
|
||
|
||
<p>如果存在这样的路径,请你返回 <code>true</code> ,否则返回 <code>false</code> 。</p>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong class="example">示例 1:</strong></p>
|
||
|
||
<div class="example-block">
|
||
<p><span class="example-io"><b>输入:</b>X = 3, Y = 4, circles = [[2,1,1]]</span></p>
|
||
|
||
<p><span class="example-io"><b>输出:</b>true</span></p>
|
||
|
||
<p><strong>解释:</strong></p>
|
||
|
||
<p><img alt="" src="https://assets.leetcode.com/uploads/2024/05/18/example2circle1.png" style="width: 346px; height: 264px;" /></p>
|
||
|
||
<p>黑色曲线表示一条从 <code>(0, 0)</code> 到 <code>(3, 4)</code> 的路径。</p>
|
||
</div>
|
||
|
||
<p><strong class="example">示例 2:</strong></p>
|
||
|
||
<div class="example-block">
|
||
<p><span class="example-io"><b>输入:</b>X = 3, Y = 3, circles = [[1,1,2]]</span></p>
|
||
|
||
<p><span class="example-io"><b>输出:</b>false</span></p>
|
||
|
||
<p><strong>解释:</strong></p>
|
||
|
||
<p><img alt="" src="https://assets.leetcode.com/uploads/2024/05/18/example1circle.png" style="width: 346px; height: 264px;" /></p>
|
||
|
||
<p>不存在从 <code>(0, 0)</code> 到 <code>(3, 3)</code> 的路径。</p>
|
||
</div>
|
||
|
||
<p><strong class="example">示例 3:</strong></p>
|
||
|
||
<div class="example-block">
|
||
<p><span class="example-io"><b>输入:</b>X = 3, Y = 3, circles = [[2,1,1],[1,2,1]]</span></p>
|
||
|
||
<p><span class="example-io"><b>输出:</b>false</span></p>
|
||
|
||
<p><b>解释:</b></p>
|
||
|
||
<p><img alt="" src="https://assets.leetcode.com/uploads/2024/05/18/example0circle.png" style="width: 346px; height: 264px;" /></p>
|
||
|
||
<p>不存在从 <code>(0, 0)</code> 到 <code>(3, 3)</code> 的路径。</p>
|
||
</div>
|
||
|
||
<p><strong class="example">示例 4:</strong></p>
|
||
|
||
<div class="example-block">
|
||
<p><strong>输入:</strong><span class="example-io">X = 4, Y = 4, circles = [[5,5,1]]</span></p>
|
||
|
||
<p><span class="example-io"><b>输出:</b>true</span></p>
|
||
|
||
<p><strong>解释:</strong></p>
|
||
|
||
<p><img alt="" src="https://assets.leetcode.com/uploads/2024/08/04/rectangles.png" style="width: 346px; height: 264px;" /></p>
|
||
</div>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>提示:</strong></p>
|
||
|
||
<ul>
|
||
<li><code>3 <= X, Y <= 10<sup>9</sup></code></li>
|
||
<li><code>1 <= circles.length <= 1000</code></li>
|
||
<li><code>circles[i].length == 3</code></li>
|
||
<li><code>1 <= x<sub>i</sub>, y<sub>i</sub>, r<sub>i</sub> <= 10<sup>9</sup></code></li>
|
||
</ul>
|