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
相关阅读
[工作机会] 坐标纽约 startup 有software engineer的空缺调查显示硅谷初创公司对多样化问题一无所知 (转载)Uber的市值到底多少?offer对身份有要求,求助版上各位大神作弊毁掉Uber的10招 (转载)有人上过太阁的项目课吗?Inductive reasoning 好难啊最近Seattle有招工没有,最近好像很少看到人postAmazon Fulfillment Technology 这个组咋样码工转Product manager内推西门子(SIEMENS)各种职位Apple Opportunity, Backend, Experienced对有色人种的偏见阻碍了硅谷变得更加多元化 (转载)Uber创始人卡兰尼克辞去CEO职务亲身领教了资本主义社会的无情开人想问下微软各级别每年的股票refresh多少和bonus一般多少leetcode高频题目 top interview questions大家都问面试官点儿啥问题现在世界上几大大公司在秘密或者公开在搞无人驾驶?如果应聘前端的职位是否也要刷题?