avatar
z*e
1
2d平面上一堆的点,要求取其中两点连线
然后正好一半的点在这条线的同侧
avatar
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)
avatar
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.
avatar
z*e
4
soga
接包子八

even
are

【在 c**1 的大作中提到】
: 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.

avatar
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 :)
avatar
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)

avatar
c*e
7
想问一下正好一半的点在这条线的同侧是什么意思?
在这条线的上点怎算哪边还是哪边都不算?

【在 z****e 的大作中提到】
: 2d平面上一堆的点,要求取其中两点连线
: 然后正好一半的点在这条线的同侧

avatar
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)

avatar
f*b
9

是的,所以楼上的方法正确的先决条件是:3点不一线+点数even

【在 c********e 的大作中提到】
: 如果a点(bottom left那个点)与b,c在同一直线上,那我们通过这方法找不到直线,
: 但是有另外的线不通过a会符合要求啊
:
: of
: you

avatar
c*e
10
可是原题无这个条件,也就是说这个方法不能解决原题,只能解决的原题特殊情况,我
的理解对吗?

【在 f*******b 的大作中提到】
:
: 是的,所以楼上的方法正确的先决条件是:3点不一线+点数even

avatar
z*3
11
为了这题还去看了下cross product的direction的expression
人生真悲剧
avatar
p*n
12
若稍改一下,是不是总有解了,即使是有三(或多)点共线
2d平面上一堆的点,要求取其中两点连线
使这条线的两侧的点数相同

even
are

【在 c**1 的大作中提到】
: 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.

avatar
m*s
13
你当下有12个包子。
回答这个可以得一个包子吧?
登陆、家页、金融中心。

what is 包子?

【在 c**1 的大作中提到】
: what is 包子? how can I check how many 包子 I have?
: I always hear people talking about 包子, but never know what it means :)

avatar
c*1
14
sent
avatar
m*s
15
哦,发财了。
谢谢

sent

【在 c**1 的大作中提到】
: sent
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。