Given n points on a 2D plane, find the maximum
number of points that lie on the same straight line. 解题想法:
其实判断一个直线上最好的方法是判断斜率。如果在同一直线上,那么直线上一点与其他点的斜率相...
分类:
其他好文 时间:
2014-05-07 21:13:02
阅读次数:
323
Chef and The Right Triangles
The Chef is given a list of N triangles. Each triangle is identfied by the coordinates of its three corners in the 2-D cartesian plane. His job is to figure out how m...
分类:
其他好文 时间:
2014-05-07 16:28:35
阅读次数:
314
骑士游历:定义了向量的数组M,行数组X,列数组Y,
棋盘plane,计数器count,走动步数step需要注意的是,递归函数的进入前的验证,原先的想法是传入来时的方向参数,可是这样的想法被实践否定了,从理论上看,一个棋子走向哪里是不受它的过去制约的,最近的过去也不例外,详情请见:http://en....
分类:
编程语言 时间:
2014-05-05 12:42:52
阅读次数:
675
Chef wrote some text on a piece of paper and now he wants to know how many holes are in the text. What is a hole? If you think of the paper as the plane and a letter as a curve on the plane, then each...
分类:
其他好文 时间:
2014-05-03 15:49:18
阅读次数:
412
DescriptionAstronomers often examine star maps
where stars are represented by points on a plane and each star has Cartesian
coordinates. Let the level...
分类:
其他好文 时间:
2014-05-01 05:42:32
阅读次数:
368