a安卓iscan红外扫描仪:计算机程序设计题目

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/05 16:11:11
求助一道ACM问题
问题如下
"How am I ever going to solve this problem?" said the pilot.

Indeed, the pilot was not facing an easy task. She had to drop packages at specific points scattered in a dangerous area. Furthermore, the pilot could only y over the area once in a straight line, and she had to y over as many points as possible. All points were given by means of integer coordinates in a two-dimensional space. The pilot wanted to know the largest number of points from the given set that all lie on one line. Can you write a program that calculates this number? Your program has to be efficient!
Input:
There are multiple test cases!
The input consists of N pairs of integers, where 1 < N < 700. Each pair of integers is separated by one blank and ended by a new-line character. The list of pairs is ended with an end-of-file character. No pair will occur twice.
The input ends with a case which N is equal to zero

Output:
The output consists of one integer representing the largest number of points that all lie on one line.
Sample Input:
5
1 1
2 2
3 3
9 10
10 11
Sample Output:
3

希望计算机专业及相关专业的人士能帮我解答
我要的是对这道问题的程序设计源代码或者你也可以说一下你的思路 但是不要麻烦 因为这道题要求的运行时间为3秒

" 我会永远如何解决这个问题? " 飞行员说. 事实上,飞行员并未面临一项非常艰巨的工作. 她在落包点具体分布在危险地区. 此外,在试验区后只能y直线,以y比她多点. 获得通过的各点整数坐标的二维空间. 想知道试验点最多的一套给所有躺在一条线. 你写程式计算这个数字? 你必须有效规划! 投入:有多种测试情况! 投入包括对integersn,1 < N < 700. 一双integers是每一个空白,并结束了与新线性质. 名单一结束,在年终案卷特点. 没有一双会出现两次. 投入的情况下,最后N等于零产量:产量由占最多的一个整数点,所有躺在一条线. 样品输入:52211339101011抽样产量:3

我会永远如何解决这个问题? " 飞行员说. 事实上,飞行员并未面临一项非常艰巨的工作. 她在落包点具体分布在危险地区. 此外,在试验区后只能y直线,以y比她多点. 获得通过的各点整数坐标的二维空间. 想知道试验点最多的一套给所有躺在一条线. 你写程式计算这个数字? 你必须有效规划! 投入:有多种测试情况! 投入包括对integersn,1 < N < 700. 一双integers是每一个空白,并结束了与新线性质. 名单一结束,在年终案卷特点. 没有一双会出现两次. 投入的情况下,最后N等于零产量:产量由占最多的一个整数点,所有躺在一条线. 样品输入:52211339101011抽样产量:3