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) 的数量,其中