当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2780:Linearity

题目描述
Alice often examines star maps where stars are represented by points in a plane and there is a Cartesian coordinate for each star. Let the Linearity of a star map be the maximum number of stars in a straight line.

For example, look at the star map shown on the figure above, the Linearity of this map is 3, because the star 1, star 2, and star 5 are within the same straight line, and there is no straight line that passes 4 stars.

You are to write a program to find the Linearity of a star map.
输入解释
Input will contain multiple test cases. Each describes a star map.

For each test case, the first line of the input contains the number of stars N (2 <= N <= 1000). The following N lines describe coordinates of stars (two integers X and Y per line separated by a space, 0 <= X, Y <= 1000). There can be only one star at one point of the plane.
输出解释
Output the Linearity of the map in a single line.
输入样例
5
0 0
2 0
0 2
1 1
2 2
输出样例
3

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-2780

最后修改于 2020-10-29T06:43:18+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
3000 65536