1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-21 21:16:45 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>给你一个以 (<code>radius</code>, <code>x_center</code>, <code>y_center</code>) 表示的圆和一个与坐标轴平行的矩形 (<code>x1</code>, <code>y1</code>, <code>x2</code>, <code>y2</code>),其中&nbsp;(<code>x1</code>, <code>y1</code>) 是矩形左下角的坐标,(<code>x2</code>, <code>y2</code>) 是右上角的坐标。</p>\n\n<p>如果圆和矩形有重叠的部分,请你返回 True ,否则返回 False&nbsp;。</p>\n\n<p>换句话说,请你检测是否 <strong>存在</strong> 点&nbsp;(xi, yi) ,它既在圆上也在矩形上(两者都包括点落在边界上的情况)。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<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>\n\n<pre><strong>输入:</strong>radius = 1, x_center = 0, y_center = 0, x1 = 1, y1 = -1, x2 = 3, y2 = 1\n<strong>输出:</strong>true\n<strong>解释:</strong>圆和矩形有公共点 (1,0) \n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<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>\n\n<pre><strong>输入:</strong>radius = 1, x_center = 0, y_center = 0, x1 = -1, y1 = 0, x2 = 0, y2 = 1\n<strong>输出:</strong>true\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<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>\n\n<pre><strong>输入:</strong>radius = 1, x_center = 1, y_center = 1, x1 = -3, y1 = -3, x2 = 3, y2 = 3\n<strong>输出:</strong>true\n</pre>\n\n<p><strong>示例 4</strong></p>\n\n<pre><strong>输入:</strong>radius = 1, x_center = 1, y_center = 1, x1 = 1, y1 = -3, x2 = 2, y2 = -1\n<strong>输出:</strong>false\n</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= radius &lt;= 2000</code></li>\n\t<li><code>-10^4 &lt;= x_center, y_center, x1, y1, x2, y2 &lt;= 10^4</code></li>\n\t<li><code>x1 &lt; x2</code></li>\n\t<li><code>y1 &lt; y2</code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 37,
"likes": 38,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -143,7 +143,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"4.5K\", \"totalSubmission\": \"10.5K\", \"totalAcceptedRaw\": 4455, \"totalSubmissionRaw\": 10546, \"acRate\": \"42.2%\"}",
"stats": "{\"totalAccepted\": \"4.6K\", \"totalSubmission\": \"10.8K\", \"totalAcceptedRaw\": 4560, \"totalSubmissionRaw\": 10806, \"acRate\": \"42.2%\"}",
"hints": [
"Locate the closest point of the square to the circle, you can then find the distance from this point to the center of the circle and check if this is less than or equal to the radius."
],