随笔分类 -  计算几何之叉积

摘要:不算严格的计算几何,就是各种分类 精度调好就能过,考虑三条边斜着放的所有情况即可 阅读全文
posted @ 2018-08-16 21:32 walfy 阅读(387) 评论(0) 推荐(0)
摘要:题意:给你n个点,要求找到一个点,和一个圆心,使得有n/2向上取整个点在圆上,一定有满足条件的点存在 题解:既然一定有解,而且圆上有n/2向上取整个点,那么我们可以通过随机来找三个点来确定一个圆心,和半径,可以看出这三个点在圆上的概率是很大的,注意要特判点数为1,2,3,4的情况 ps:一开始想的是 阅读全文
posted @ 2017-11-13 13:34 walfy 阅读(382) 评论(0) 推荐(0)
摘要:You are to write a program that has to decide whether a given line segment intersects a given rectangle. An example: line: start point: (4,9) end poin 阅读全文
posted @ 2017-04-10 14:58 walfy 阅读(452) 评论(0) 推荐(0)
摘要:Stan has n sticks of various length. He throws them one at a time on the floor in a random way. After finishing throwing, Stan tries to find the top s 阅读全文
posted @ 2017-04-09 21:29 walfy 阅读(283) 评论(0) 推荐(0)
摘要:We all know that a pair of distinct points on a plane defines a line and that a pair of lines on a plane will intersect in one of three ways: 1) no in 阅读全文
posted @ 2017-04-08 18:47 walfy 阅读(469) 评论(0) 推荐(0)
摘要:Given n segments in the two dimensional space, write a program, which determines if there exists a line such that after projecting these segments on i 阅读全文
posted @ 2017-04-08 16:46 walfy 阅读(418) 评论(0) 推荐(0)
摘要:Mom and dad have a problem: their child, Reza, never puts his toys away when he is finished playing with them. They gave Reza a rectangular box to put 阅读全文
posted @ 2017-04-08 13:53 walfy 阅读(464) 评论(0) 推荐(0)