
计算几何
计算几何
Herod_
这个作者很懒,什么都没留下…
展开
-
HDU-2108- Shape of HDU(叉乘判断凸多边形)
Shape of HDUProblem Description话说上回讲到海东集团推选老总的事情,最终的结果是XHD以微弱优势当选,从此以后,“徐队”的称呼逐渐被“徐总”所取代,海东集团(HDU)也算是名副其实了。创业是需要地盘的,HDU向钱江肉丝高新技术开发区申请一块用地,很快得到了批复,据说这是因为他们公司研发的“海东牌”老鼠药科技含量很高,预期将占全球一半以上的市场。政府划拨的这块用地是一个多边形,为了描述它,我们用逆时针方向的顶点序列来表示,我们很想了解这块地的基本情况,现在请你编程判断HDU原创 2020-09-03 11:09:54 · 699 阅读 · 0 评论 -
HDU-3103-Shoring Up the Levees(简单几何)
Shoring Up the LeveesProblem DescriptionThe tiny country of Waterlogged is protected by a series of levees that form a quadrilateral as shown below:The quadrilateral is defined by four vertices. The levees partition the country into four quadrants. Each原创 2020-09-01 16:07:35 · 214 阅读 · 0 评论 -
模板:简单计算几何
typedef double db;const db eps = 1e-8;const db inf = 1e20;const db pi = acos(-1.0);int sgn(db x){ if(fabs(x) < eps)return 0; if(x < 0)return -1; else return 1;}struct Point{ db x, y; Point(){} Point(db _x, db _y){ x = _x; y = _y; }原创 2020-08-20 18:39:37 · 150 阅读 · 0 评论 -
2019 ICPC 南京 K.Triangle(二分+几何)
题意:给一个三角形,以及一个点(某条线段的端点),让求出另一点,使得这个线段平分这个三角形即两部分面积相等。思路:读完题就觉得是二分,奈何没有板子敲了半天,面积还是算不出来,最后抄了一手板子一发过。首先如果p点不在三角形上面,直接输出-1如果在三角形上面,那么可以判断出另一点是在另外两条边的哪条边上,比如p点在ab上且离a更近,那么 必然在bc上,反之在ac上。代码:#include <cstdio>#include <vector>#include <que原创 2020-08-20 18:22:50 · 895 阅读 · 1 评论 -
Codeforces-1216-C. White Sheet(基础几何)
C. White SheetThere is a white sheet of paper lying on a rectangle table. The sheet is a rectangle with its sides parallel to the sides of the table. If you will take a look from above and assume tha...原创 2019-09-22 15:59:41 · 523 阅读 · 0 评论