c*1
2 楼
this works when no 3 points in the same line, and of course total number of
points is even.
find the point with lowest Y, break tie by choosing lowest X. name it a
for each other point b, calculate the angle between line ab and x axis
c is the median of all other points by comparing the angle, ac is what you
want.
O(n)
points is even.
find the point with lowest Y, break tie by choosing lowest X. name it a
for each other point b, calculate the angle between line ab and x axis
c is the median of all other points by comparing the angle, ac is what you
want.
O(n)
c*1
3 楼
and there might be no solution at all if existing 3 points in a line, even
when total number is even. think the extreme case when all 2k+2 points are
on the same line.
when total number is even. think the extreme case when all 2k+2 points are
on the same line.
c*1
5 楼
what is 包子? how can I check how many 包子 I have?
I always hear people talking about 包子, but never know what it means :)
I always hear people talking about 包子, but never know what it means :)
u*o
6 楼
哇塞,果真是重赏之下必有勇夫。。这招好啊
of
you
【在 c**1 的大作中提到】
: this works when no 3 points in the same line, and of course total number of
: points is even.
: find the point with lowest Y, break tie by choosing lowest X. name it a
: for each other point b, calculate the angle between line ab and x axis
: c is the median of all other points by comparing the angle, ac is what you
: want.
: O(n)
of
you
【在 c**1 的大作中提到】
: this works when no 3 points in the same line, and of course total number of
: points is even.
: find the point with lowest Y, break tie by choosing lowest X. name it a
: for each other point b, calculate the angle between line ab and x axis
: c is the median of all other points by comparing the angle, ac is what you
: want.
: O(n)
c*e
8 楼
如果a点(bottom left那个点)与b,c在同一直线上,那我们通过这方法找不到直线,
但是有另外的线不通过a会符合要求啊
of
you
【在 c**1 的大作中提到】
: this works when no 3 points in the same line, and of course total number of
: points is even.
: find the point with lowest Y, break tie by choosing lowest X. name it a
: for each other point b, calculate the angle between line ab and x axis
: c is the median of all other points by comparing the angle, ac is what you
: want.
: O(n)
但是有另外的线不通过a会符合要求啊
of
you
【在 c**1 的大作中提到】
: this works when no 3 points in the same line, and of course total number of
: points is even.
: find the point with lowest Y, break tie by choosing lowest X. name it a
: for each other point b, calculate the angle between line ab and x axis
: c is the median of all other points by comparing the angle, ac is what you
: want.
: O(n)
z*3
11 楼
为了这题还去看了下cross product的direction的expression
人生真悲剧
人生真悲剧
c*1
14 楼
sent
相关阅读
小公司电面, 现场跑code, 哎, 压力大。侯机厅一对让我恶心的老男女骑驴找马结束,分享面试题回馈贵版招聘 SW Quality Engineer-Plano TX非互联网公司的码工转行互联网公司是不是算entry level计算机二级考试 南开百题难度如何同学转我个帖子,这才是人生赢家Uber is going to IPO in 18-24 months哈哈 现在几大公司都公开不招新生了Amazon入职两个月就被pip 求支招暂停opt请问box这个公司怎么样?进去还有多少油水????公司关门,今天告诉大家就让走人不要怪千老,千老只是图样图森破求教一道昂赛特设计题CODE JAM PROGRAMMER 招人。。用技术水平衡量人的二逼不得好死,被烙印干死电面在线写code憋的想骂街Updated 8/20/15: Breaking News on OPT STEM Extension! (转载)长期提供Facebook / Instagram 内推并附面试建议