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

建议使用的浏览器:

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

3512:Incidental Points

题目描述

Unlike a straight line, a straight segment between two points P1, P2 (normally written as P1P2) is a line that links the two points but doesn’t extend beyond them. A third point P3 is said to be incident to P1P2 iff P3 lies on the straight line and between the points P1 and P2. P1P2 is said to include P3. By definition, P1 and P2 are included in P1P2. Write a program to find the segment that includes the most number of given points.

输入解释

Your program will be tested on one or more test cases. Each test case includes a set of two or more unique points, where the Cartesian coordinates of each point is specified on a separate line using two integers X and Y where 0 ≤ |X|, |Y| < 1,000,000. No test case has more than 1000 points. An input line made of two or more '-' (minus signs) signals the end of a test case. An extra input line of two or more '-' (minus signs) follow the last test case.

输出解释

For each test case, output the result on a single line using the following format:

k. n

Where k is the test case number (starting at 1), and n is the number of points on the segment.

输入样例
1 1
1 5
5 9
9 5
5 5
3 2
5 3
----
1 5
5 1
1 1
5 5
--
--------
输出样例
1. 4
2. 2

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

源链接: POJ-3512

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

共提交 0

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