原文链接: https://leetcode-cn.com/problems/max-points-on-a-line 英文原文Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane, return the maximum number of points that lie on the same straight line. Example 1: Input: points …
标签详情
几何 分类
原文链接: https://leetcode-cn.com/problems/rectangle-area 英文原文Given the coordinates of two rectilinear rectangles in a 2D plane, return the total area covered by the two rectangles. The first rectangle is defined by its bottom-left corner (ax1, ay1) and …
原文链接: https://leetcode-cn.com/problems/erect-the-fence 英文原文You are given an array trees where trees[i] = [xi, yi] represents the location of a tree in the garden. You are asked to fence the entire garden using the minimum length of rope as it is expe…
原文链接: https://leetcode-cn.com/problems/valid-square 英文原文Given the coordinates of four points in 2D space p1, p2, p3 and p4, return true if the four points construct a square. The coordinate of a point pi is represented as [xi, yi]. The input is not g…
原文链接: https://leetcode-cn.com/problems/rectangle-overlap 英文原文An axis-aligned rectangle is represented as a list [x1, y1, x2, y2], where (x1, y1) is the coordinate of its bottom-left corner, and (x2, y2) is the coordinate of its top-right corner. Its …
原文链接: https://leetcode-cn.com/problems/mirror-reflection 英文原文There is a special square room with mirrors on each of the four walls. Except for the southwest corner, there are receptors on each of the remaining corners, numbered 0, 1, and 2. The squar…
原文链接: https://leetcode-cn.com/problems/generate-random-point-in-a-circle 英文原文Given the radius and the position of the center of a circle, implement the function randPoint which generates a uniform random point inside the circle. Implement the Solutio…
原文链接: https://leetcode-cn.com/problems/projection-area-of-3d-shapes 英文原文You are given an n x n grid where we place some 1 x 1 x 1 cubes that are axis-aligned with the x, y, and z axes. Each value v = grid[i][j] represents a tower of v cubes placed on…
原文链接: https://leetcode-cn.com/problems/surface-area-of-3d-shapes 英文原文You are given an n x n grid where you have placed some 1 x 1 x 1 cubes. Each value v = grid[i][j] represents a tower of v cubes placed on top of cell (i, j). After placing these cub…
原文链接: https://leetcode-cn.com/problems/minimum-area-rectangle 英文原文You are given an array of points in the X-Y plane points where points[i] = [xi, yi]. Return the minimum area of a rectangle formed from these points, with sides parallel to the X and Y…
原文链接: https://leetcode-cn.com/problems/minimum-area-rectangle-ii 英文原文You are given an array of points in the X-Y plane points where points[i] = [xi, yi]. Return the minimum area of any rectangle formed from these points, with sides not necessarily pa…
原文链接: https://leetcode-cn.com/problems/k-closest-points-to-origin 英文原文Given an array of points where points[i] = [xi, yi] represents a point on the X-Y plane and an integer k, return the k closest points to the origin (0, 0). The distance between two…
原文链接: https://leetcode-cn.com/problems/matrix-cells-in-distance-order 英文原文You are given four integers row, cols, rCenter, and cCenter. There is a rows x cols matrix and you are on the cell with the coordinates (rCenter, cCenter). Return the coordinat…
原文链接: https://leetcode-cn.com/problems/minimum-time-visiting-all-points 英文原文On a 2D plane, there are n points with integer coordinates points[i] = [xi, yi]. Return the minimum time in seconds to visit all the points in the order given by points. You …
原文链接: https://leetcode-cn.com/problems/circle-and-rectangle-overlapping 英文原文Given a circle represented as (radius, x_center, y_center) and an axis-aligned rectangle represented as (x1, y1, x2, y2), where (x1, y1) are the coordinates of the bottom-lef…
原文链接: https://leetcode-cn.com/problems/maximum-number-of-darts-inside-of-a-circular-dartboard 英文原文You have a very large square wall and a circular dartboard placed on the wall. You have been challenged to throw darts into the board blindfolded. Darts…
原文链接: https://leetcode-cn.com/problems/best-position-for-a-service-centre 英文原文A delivery company wants to build a new service centre in a new city. The company knows the positions of all the customers in this city on a 2D-Map and wants to build the n…
原文链接: https://leetcode-cn.com/problems/maximum-number-of-visible-points 英文原文You are given an array points, an integer angle, and your location, where location = [posx, posy] and points[i] = [xi, yi] both denote integral coordinates on the X-Y plane. …
原文链接: https://leetcode-cn.com/problems/bisect-squares-lcci 英文原文Given two squares on a two-dimensional plane, find a line that would cut these two squares in half. Assume that the top and the bottom sides of the square run parallel to the x-axis. Each…
原文链接: https://leetcode-cn.com/problems/best-line-lcci 英文原文Given a two-dimensional graph with points on it, find a line which passes the most number of points. Assume all the points that passed by the line are stored in list S sorted by their number. …
原文链接: https://leetcode-cn.com/problems/you-le-yuan-de-you-lan-ji-hua 英文原文 中文题目又到了一年一度的春游时间,小吴计划去游乐场游玩 1 天,游乐场总共有 N 个游乐项目,编号从 0 到 N-1。小吴给每个游乐项目定义了一个非负整数值 value[i] 表示自己的喜爱值。两个游乐项目之间会有双向路径相连,整个游乐场总共有 M 条双向路径,保存在二维数组 edges中。 小吴计划选择一个游乐项目 A 作为这一天游玩的重点项目。上…
原文链接: https://leetcode-cn.com/problems/you-le-yuan-de-mi-gong 英文原文 中文题目小王来到了游乐园,她玩的第一个项目是模拟推销员。有一个二维平面地图,其中散布着 N 个推销点,编号 0 到 N-1,不存在三点共线的情况。每两点之间有一条直线相连。游戏没有规定起点和终点,但限定了每次转角的方向。首先,小王需要先选择两个点分别作为起点和终点,然后从起点开始访问剩余 N-2 个点恰好一次并回到终点。访问的顺序需要满足一串给定的长度为 N-2 …
原文链接: https://leetcode-cn.com/problems/zui-xiao-ju-xing-mian-ji 英文原文 中文题目二维平面上有 $N$ 条直线,形式为 `y = kx + b`,其中 `k`、`b`为整数 且 `k > 0`。所有直线以 `[k,b]` 的形式存于二维数组 `lines` 中,不存在重合的两条直线。两两直线之间可能存在一个交点,最多会有 $C_N^2$ 个交点。我们用一个平行于坐标轴的矩形覆盖所有的交点,请问这个矩形最小面积是多少。若直线之间无交点…
原文链接: https://leetcode-cn.com/problems/vFjcfV 英文原文 中文题目「力扣挑战赛」场地外,小力组织了一个套玩具的游戏。所有的玩具摆在平地上,`toys[i]` 以 `[xi,yi,ri]` 的形式记录了第 `i` 个玩具的坐标 `(xi,yi)` 和半径 `ri`。小扣试玩了一下,他扔了若干个半径均为 `r` 的圈,`circles[j]` 记录了第 `j` 个圈的坐标 `(xj,yj)`。套圈的规则如下: - 若一个玩具被某个圈完整覆盖了(即玩具的任意…