Leetcode-cn.com 2022-06-05
🟡 478.generate-random-point-in-a-circle
🏷️ Tags
#geometry #math #rejection_sampling #randomized
Description
给定圆的半径和圆心的位置,实现函数
实现
Example
🟡 478.generate-random-point-in-a-circle
🏷️ Tags
#geometry #math #rejection_sampling #randomized
Description
给定圆的半径和圆心的位置,实现函数
randPoint ,在圆中产生均匀随机点。实现
Solution 类:Solution(double radius, double x_center, double y_center) 用圆的半径 radius 和圆心的位置 (x_center, y_center) 初始化对象randPoint() 返回圆内的一个随机点。圆周上的一点被认为在圆内。答案作为数组返回 [x, y] 。Example
输入:
["Solution","randPoint","randPoint","randPoint"]
[[1.0, 0.0, 0.0], [], [], []]
输出: [null, [-0.02493, -0.38077], [0.82314, 0.38945], [0.36572, 0.17248]]
解释:
Solution solution = new Solution(1.0, 0.0, 0.0);
solution.randPoint ();//返回[-0.02493,-0.38077]
solution.randPoint ();//返回[0.82314,0.38945]
solution.randPoint ();//返回[0.36572,0.17248]
1828.queries-on-number-of-points-inside-a-circle.pdf
223.4 KB
leetcode.cn 2023-01-24
🟡1828.queries-on-number-of-points-inside-a-circle
🏷️ Tags
#geometry #array #math
🟡1828.queries-on-number-of-points-inside-a-circle
🏷️ Tags
#geometry #array #math
leetcode.com 2023-06-02
🟡2101.detonate-the-maximum-bombs
🏷️ Tags
#depth_first_search #breadth_first_search #graph #geometry #array #math
🟡2101.detonate-the-maximum-bombs
🏷️ Tags
#depth_first_search #breadth_first_search #graph #geometry #array #math
Telegraph
detonate-the-maximum-bombs
You are given a list of bombs. The range of a bomb is defined as the area where its effect can be felt. This area is in the shape of a circle with the center as the location of the bomb. The bombs are represented by a 0-indexed 2D integer array bombs where…
leetcode.cn 2025-09-02
🟡3025.find-the-number-of-ways-to-place-people-i
🏷️ Tags
#geometry #array #math #enumeration #sorting
🟡3025.find-the-number-of-ways-to-place-people-i
🏷️ Tags
#geometry #array #math #enumeration #sorting
Telegraph
find-the-number-of-ways-to-place-people-i
给你一个 n x 2 的二维数组 points ,它表示二维平面上的一些点坐标,其中 points[i] = [xi, yi] 。 计算点对 (A, B) 的数量,其中
leetcode.com 2025-09-02
🟡3025.find-the-number-of-ways-to-place-people-i
🏷️ Tags
#geometry #array #math #enumeration #sorting
🟡3025.find-the-number-of-ways-to-place-people-i
🏷️ Tags
#geometry #array #math #enumeration #sorting
Telegraph
find-the-number-of-ways-to-place-people-i
You are given a 2D array points of size n x 2 representing integer coordinates of some points on a 2D plane, where points[i] = [xi, yi]. Count the number of pairs of points (A, B), where
leetcode.cn 2025-09-03
🔴3027.find-the-number-of-ways-to-place-people-ii
🏷️ Tags
#geometry #array #math #enumeration #sorting
🔴3027.find-the-number-of-ways-to-place-people-ii
🏷️ Tags
#geometry #array #math #enumeration #sorting
Telegraph
find-the-number-of-ways-to-place-people-ii
给你一个 n x 2 的二维数组 points ,它表示二维平面上的一些点坐标,其中 points[i] = [xi, yi] 。 我们定义 x 轴的正方向为 右 (x 轴递增的方向),x 轴的负方向为 左 (x 轴递减的方向)。类似的,我们定义 y 轴的正方向为 上 (y 轴递增的方向),y 轴的负方向为 下 (y 轴递减的方向)。 你需要安排这 n 个人的站位,这 n 个人中包括 Alice 和 Bob 。你需要确保每个点处 恰好 有 一个 人。同时,Alice 想跟 Bob 单独玩耍,所以 Alice…
leetcode.com 2025-09-03
🔴3027.find-the-number-of-ways-to-place-people-ii
🏷️ Tags
#geometry #array #math #enumeration #sorting
🔴3027.find-the-number-of-ways-to-place-people-ii
🏷️ Tags
#geometry #array #math #enumeration #sorting
Telegraph
find-the-number-of-ways-to-place-people-ii
You are given a 2D array points of size n x 2 representing integer coordinates of some points on a 2D-plane, where points[i] = [xi, yi]. We define the right direction as positive x-axis (increasing x-coordinate) and the left direction as negative x-axis (decreasing…