计算几何
·马克图布·
如果人生真的可以分为几个阶段的话,那么我现在就在感觉自己很普通,并一无是处的那个阶段。
展开
-
计算几何 —— 线段性质
杭电课件struct Point { //点 double x, y;};struct Segments { //线段 Point A, B;}Seg[1005];double Matrix(Point a,Point b,Point c) {//行列式计算,即叉乘 double x1 = c.x - a.x; double y1 = c.y - a.y; doub...原创 2019-10-19 21:56:40 · 163 阅读 · 0 评论 -
poj1558 Segment set(线段相交 + 并查集)
Problem DescriptionA segment and all segments which are connected with it compose a segment set. The size of a segment set is the number of segments in it. The problem is to find the size of some se...原创 2019-08-05 01:16:34 · 193 阅读 · 0 评论 -
hdu1086 You can Solve a Geometry Problem too(线段相交)
Problem DescriptionMany geometry(几何)problems were designed in the ACM/ICPC. And now, I also prepare a geometry problem for this final exam. According to the experience of many ACMers, geometry probl...原创 2019-08-05 00:41:32 · 166 阅读 · 0 评论 -
A. Where do I Turn?(计算几何:判断点在直线哪侧)
Trouble came from the overseas lands: a three-headed dragon Gorynych arrived. The dragon settled at point C and began to terrorize the residents of the surrounding villages.A brave hero decided to p...原创 2019-07-27 01:12:54 · 226 阅读 · 0 评论 -
叉积在ACM中的应用
{ 转自 ——>https://blog.csdn.net/danliwoo/article/details/49836983 }定义若 = =定义叉积 :× = x1y2 - x2y1性质1、 = 如图是一种简单情况,叉积表示的面积即最大的矩形面积减去 P1P2T3所构成的矩形面积。又T4=S4,即要证2(T1+T2+T3...转载 2019-07-26 14:01:52 · 221 阅读 · 0 评论 -
ACM中的浮点数精度处理
在ACM中,精度问题非常常见。其中计算几何头疼的地方一般在于代码量大和精度问题,代码量问题只要平时注意积累模板一般就不成问题了。精度问题则不好说,有时候一个精度问题就可能成为一道题的瓶颈,让你debug半天都找不到错误出在哪。1.浮点数为啥会有精度问题:浮点数(以C/C++为准),一般用的较多的是float, double。 占字节数 ...转载 2019-07-26 13:09:11 · 318 阅读 · 0 评论 -
hdu2036 改革春风吹满地(计算几何:其任意多边形面积)
Problem Description“ 改革春风吹满地,不会AC没关系;实在不行回老家,还有一亩三分地。谢谢!(乐队奏乐)”话说部分学生心态极好,每天就知道游戏,这次考试如此简单的题目,也是云里雾里,而且,还竟然来这么几句打油诗。好呀,老师的责任就是帮你解决问题,既然想种田,那就分你一块。这块田位于浙江省温州市苍南县灵溪镇林家铺子村,多边形形状的一块地,原本是linle 的,现...原创 2019-07-14 15:37:44 · 194 阅读 · 0 评论 -
P2735 电网 Electric Fences(pick定理)
题目描述在本题中,格点是指横纵坐标皆为整数的点。为了圈养他的牛,农夫约翰(Farmer John)建造了一个三角形的电网。他从原点(0,0)牵出一根通电的电线,连接格点(n,m)(0<=n<32000,0<m<32000),再连接格点(p,0)(p>0),最后回到原点。牛可以在不碰到电网的情况下被放到电网内部的每一个格点上(十分瘦的牛)。如果一个格点碰到了...原创 2019-06-23 18:06:49 · 265 阅读 · 0 评论 -
poj2954 Triangle(计算几何:pick公式)
Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6503 Accepted: 2783 DescriptionA lattice point is an ordered pair (x, y) where x and y are both integers. Given the ...原创 2019-06-23 14:54:31 · 182 阅读 · 0 评论 -
CodeForces - 140A. New Year Table(注意精度)
Gerald is setting the New Year table. The table has the form of a circle; its radius equals R. Gerald invited many guests and is concerned whether the table has enough space for plates for all those g...原创 2019-06-08 21:43:07 · 219 阅读 · 0 评论 -
B. Vasya and Cornfield(线性规划)
Vasya owns a cornfield which can be defined with two integers nn and dd . The cornfield can be represented as rectangle with vertices having Cartesian coordinates (0,d),(d,0),(n,n−d)(0,d),(d,0),(n,n−d...原创 2019-05-23 19:21:28 · 317 阅读 · 0 评论