Problem
You probably know what a set of collinear points is: a set of points such that there exists a straight line that passes through all of them. A set of cocircular points is defined in the same fashion, but instead of a straight line, we ask that there is a circle such that every point of the set lies over its perimeter.
The International Collinear Points Centre (ICPC) has assigned you the following task: given a set of points, calculate the size of the larger subset of cocircular points.
Input
Each test case is given using several lines. The first line contains an integer N representing the number of points in the set (1$\le$N$\le$100). Each of the next N lines contains two integers X and Y representing the coordinates of a point of the set (- 104$\le$X, Y$\le$104). Within each test case, no two points have the same location.
The last test case is followed by a line containing one zero.
Output
For each test case output a single line with a single integer representing the number of points in one of the largest subsets of the input that are cocircular.
Sample Input
|
|
Sample Output
|
|
Solution
題目描述:
給平面上 n 個點,最多有多少個點共圓?
題目解法:
窮舉三點拉外心,隨後找共圓的點,最慘會到 O(n^4)。
完全沒有剪枝,也就是說可以刻意將點保留標記,防止窮舉到相同組合,又或者是先按照 x 軸排序,直接在區間內搜索可能的共圓點之類的。
|
|