mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-13 03:11:42 +08:00
存量题库数据更新
This commit is contained in:
@@ -1,49 +1,40 @@
|
||||
<p>给你一个以 (<code>radius</code>, <code>x_center</code>, <code>y_center</code>) 表示的圆和一个与坐标轴平行的矩形 (<code>x1</code>, <code>y1</code>, <code>x2</code>, <code>y2</code>),其中 (<code>x1</code>, <code>y1</code>) 是矩形左下角的坐标,(<code>x2</code>, <code>y2</code>) 是右上角的坐标。</p>
|
||||
<p>给你一个以 <code>(radius, xCenter, yCenter)</code> 表示的圆和一个与坐标轴平行的矩形 <code>(x1, y1, x2, y2)</code> ,其中 <code>(x1, y1)</code> 是矩形左下角的坐标,而 <code>(x2, y2)</code> 是右上角的坐标。</p>
|
||||
|
||||
<p>如果圆和矩形有重叠的部分,请你返回 True ,否则返回 False 。</p>
|
||||
<p>如果圆和矩形有重叠的部分,请你返回 <code>true</code> ,否则返回 <code>false</code> 。</p>
|
||||
|
||||
<p>换句话说,请你检测是否 <strong>存在</strong> 点 (xi, yi) ,它既在圆上也在矩形上(两者都包括点落在边界上的情况)。</p>
|
||||
<p>换句话说,请你检测是否 <strong>存在</strong> 点 <code>(x<sub>i</sub>, y<sub>i</sub>)</code> ,它既在圆上也在矩形上(两者都包括点落在边界上的情况)。</p>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>示例 1:</strong></p>
|
||||
|
||||
<p><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2020/04/04/sample_4_1728.png" style="height: 167px; width: 258px;"></p>
|
||||
|
||||
<pre><strong>输入:</strong>radius = 1, x_center = 0, y_center = 0, x1 = 1, y1 = -1, x2 = 3, y2 = 1
|
||||
<p><strong class="example">示例 1 :</strong></p>
|
||||
<img alt="" src="https://assets.leetcode.com/uploads/2020/02/20/sample_4_1728.png" style="width: 258px; height: 167px;" />
|
||||
<pre>
|
||||
<strong>输入:</strong>radius = 1, xCenter = 0, yCenter = 0, x1 = 1, y1 = -1, x2 = 3, y2 = 1
|
||||
<strong>输出:</strong>true
|
||||
<strong>解释:</strong>圆和矩形有公共点 (1,0)
|
||||
<strong>解释:</strong>圆和矩形存在公共点 (1,0) 。
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 2:</strong></p>
|
||||
<p><strong class="example">示例 2 :</strong></p>
|
||||
|
||||
<p><strong><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2020/04/04/sample_2_1728.png" style="height: 135px; width: 150px;"></strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>radius = 1, x_center = 0, y_center = 0, x1 = -1, y1 = 0, x2 = 0, y2 = 1
|
||||
<strong>输出:</strong>true
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 3:</strong></p>
|
||||
|
||||
<p><strong><img alt="" src="https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2020/04/04/sample_6_1728.png" style="height: 165px; width: 175px;"></strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>radius = 1, x_center = 1, y_center = 1, x1 = -3, y1 = -3, x2 = 3, y2 = 3
|
||||
<strong>输出:</strong>true
|
||||
</pre>
|
||||
|
||||
<p><strong>示例 4:</strong></p>
|
||||
|
||||
<pre><strong>输入:</strong>radius = 1, x_center = 1, y_center = 1, x1 = 1, y1 = -3, x2 = 2, y2 = -1
|
||||
<pre>
|
||||
<strong>输入:</strong>radius = 1, xCenter = 1, yCenter = 1, x1 = 1, y1 = -3, x2 = 2, y2 = -1
|
||||
<strong>输出:</strong>false
|
||||
</pre>
|
||||
|
||||
<p><strong class="example">示例 3 :</strong></p>
|
||||
<img alt="" src="https://assets.leetcode.com/uploads/2020/02/20/sample_2_1728.png" style="width: 150px; height: 135px;" />
|
||||
<pre>
|
||||
<strong>输入:</strong>radius = 1, xCenter = 0, yCenter = 0, x1 = -1, y1 = 0, x2 = 0, y2 = 1
|
||||
<strong>输出:</strong>true
|
||||
</pre>
|
||||
|
||||
<p> </p>
|
||||
|
||||
<p><strong>提示:</strong></p>
|
||||
|
||||
<ul>
|
||||
<li><code>1 <= radius <= 2000</code></li>
|
||||
<li><code>-10^4 <= x_center, y_center, x1, y1, x2, y2 <= 10^4</code></li>
|
||||
<li><code>x1 < x2</code></li>
|
||||
<li><code>y1 < y2</code></li>
|
||||
<li><code>-10<sup>4</sup> <= xCenter, yCenter <= 10<sup>4</sup></code></li>
|
||||
<li><code>-10<sup>4</sup> <= x1 < x2 <= 10<sup>4</sup></code></li>
|
||||
<li><code>-10<sup>4</sup> <= y1 < y2 <= 10<sup>4</sup></code></li>
|
||||
</ul>
|
||||
|
Reference in New Issue
Block a user