几何
Modiz
这个作者很懒,什么都没留下…
展开
-
(CF)B. Restore Cube (暴力枚举判断)
B. Restore Cubetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPeter had a cube with non-zero length of a s原创 2014-09-09 21:18:35 · 814 阅读 · 0 评论 -
湖南省第十届程序设计竞赛第一题:点到圆弧的距离
分别输入起始点A,经过的点B,和结束点C的原创 2014-10-14 21:54:58 · 813 阅读 · 0 评论 -
hdu5120 Intersection(求两个圆环相交的面积)
IntersectionTime Limit: 4000/4000 MS (Java/Others) Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 206 Accepted Submission(s): 86Problem DescriptionMatt is a big原创 2014-12-01 16:52:30 · 1347 阅读 · 0 评论 -
poj1228 (判断凸包的完整性)
Grandpa's EstateTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 11185 Accepted: 3081DescriptionBeing the only living descendant of his grandfather, Kamr原创 2015-03-20 10:21:29 · 529 阅读 · 0 评论 -
poj3348(求凸包的面积)graham算法。
CowsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 7157 Accepted: 3285DescriptionYour friend to the south is interested in building fences and turnin原创 2015-03-20 11:58:14 · 509 阅读 · 0 评论 -
求凸包面积:poj3348
CowsTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 6299 Accepted: 2880DescriptionYour friend to the south is interested in building fences and turning原创 2014-05-05 20:25:06 · 777 阅读 · 0 评论 -
高斯消元模板
#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#include#define LL原创 2015-03-23 21:50:03 · 679 阅读 · 0 评论 -
poj1265 & poj2954(皮克定理pick)在格点上的多边形求面积公式
题目就不贴了。大概都是pick定理解决。pick:S=a+b/2-1。s是多边形面积,a是多边形内的格点,b是多边形线或者顶点上的格点。多边形线上的格点用gcd定理求。两顶点x和y变化的坐标最大公约数即是格点在这条线上的数量。poj1265:#include#include#include#include#include#include#include#include原创 2015-03-20 19:10:01 · 930 阅读 · 0 评论 -
poj1584(判断多边形是否凸包,判断圆是否在多边形内)
A Round Peg in a Ground HoleTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 5426 Accepted: 1723DescriptionThe DIY Furniture company specializes in ass原创 2015-03-17 10:35:57 · 557 阅读 · 0 评论 -
Modiz 《几何模板》
#include#include#include#include#include#include#define eps 1e-9#includeusing namespace std;const double PI = acos(-1.0);int dcmp( double x ){ if( abs(x) < eps ) return 0;else return x < 0?-原创 2014-09-26 19:01:45 · 724 阅读 · 0 评论 -
poj2826 An Easy Problem?!
An Easy Problem?!Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9916 Accepted: 1497DescriptionIt's raining outside. Farmer Johnson's bull Ben wants s原创 2015-03-10 19:18:59 · 516 阅读 · 0 评论 -
poj1039 Pipe 线段与直线的交点
PipeTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 9393 Accepted: 2849DescriptionThe GX Light Pipeline Company started to prepare bent pipes for the原创 2015-03-13 20:39:39 · 542 阅读 · 0 评论 -
[湖大热身赛]Pesky Mosquitoes(求圆覆盖最大点数)
Pesky MosquitoesTime Limit: 4000ms, Special Time Limit:10000ms, Memory Limit:65536KBTotal submit users: 8, Accepted users: 8Problem 13239 : No special judgementProblem descript原创 2015-03-14 18:39:38 · 764 阅读 · 0 评论 -
poj1873 The Fortified Forest(位运算枚举+凸包)
The Fortified ForestTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 5511 Accepted: 1567DescriptionOnce upon a time, in a faraway land, there lived a k原创 2015-03-18 22:17:42 · 504 阅读 · 2 评论 -
割耳法(几何)
E - 割耳法Time Limit:3000MS Memory Limit:131072KB 64bit IO Format:%lld & %lluSubmit Status Practice CSU 1332Description割耳法可以把一个多边形切成三角形:每次沿着某条对角线切下来一个三角形(称为“耳朵”),n-3次就能把一个n边形切原创 2014-10-04 19:22:20 · 3053 阅读 · 0 评论 -
uva11796 Dog Distance
Appoint description: System Crawler (2014-10-04)Description CDog DistanceInputStandard InputOutputStandard OutputTwo dogs, Rang原创 2014-10-04 21:20:27 · 750 阅读 · 0 评论 -
hiho 矩形判断
向量a=(x1,y1),向量b=(x2,y2),a∥b的充要条件(或说成等价于)是x1y2-x2y1=0;a⊥b的充要条件(或说成等价于)是x1x2+y1y2=0;原创 2014-09-12 19:41:06 · 1074 阅读 · 0 评论 -
poj2653 Pick-up sticks
Pick-up sticksTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 9993 Accepted: 3715DescriptionStan has n sticks of various length. He throws them one at原创 2014-11-08 19:39:02 · 783 阅读 · 0 评论 -
poj2318 Toys
TOYSTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 10735 Accepted: 5169DescriptionCalculate the number of toys that land in each bin of a partitioned t原创 2014-11-07 11:55:09 · 621 阅读 · 0 评论 -
poj 2398Toy Storage
Toy StorageTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 4063 Accepted: 2410DescriptionMom and dad have a problem: their child, Reza, never puts his原创 2014-11-07 13:00:32 · 754 阅读 · 0 评论 -
poj 1269 Intersecting Lines
Intersecting LinesTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 11303 Accepted: 5109DescriptionWe all know that a pair of distinct points on a plane d原创 2014-11-07 18:22:35 · 735 阅读 · 0 评论 -
poj1556 The Doors
The DoorsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 6410 Accepted: 2571DescriptionYou are to find the length of the shortest path through a chamb原创 2014-11-08 16:44:47 · 735 阅读 · 0 评论 -
poj3304 Segments
SegmentsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9898 Accepted: 3050DescriptionGiven n segments in the two dimensional space, write a program, wh原创 2014-11-07 16:42:49 · 685 阅读 · 0 评论 -
poj1066 Treasure Hunt
Treasure HuntTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 5579 Accepted: 2316DescriptionArcheologists from the Antiquities and Curios Museum (ACM)原创 2014-11-09 19:47:46 · 668 阅读 · 0 评论 -
poj1410 Intersection
IntersectionTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 11953 Accepted: 3096DescriptionYou are to write a program that has to decide whether a giv原创 2014-11-09 21:21:36 · 667 阅读 · 0 评论 -
Poj1696 Space Ant
Space AntTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 3193 Accepted: 2047DescriptionThe most exciting space discovery occurred at the end of the 20原创 2014-11-10 20:33:33 · 689 阅读 · 0 评论 -
判断平面上两线段是否相交,顺便解释判断点在直线的位置...
首先引出计算几何学中一个最基本的问题:如何判断向量在的顺时针方向还是逆时针方向?把p0定为原点,p1的坐标是(x1,y1),p2的坐标是(x2,y2)。向量的叉积(cross product)实际上就是矩阵的行列式:当叉积为正时,说明在的顺时针方向上;叉积为0说明两向量共线(同向或反向)。当同时满足:(1)和在的两侧(即一个顺时针方向上,一个在逆时针方向上)(2)和在的两侧转载 2013-08-12 16:03:12 · 1544 阅读 · 0 评论 -
判断线段是否相交...并求出交点。
判断直线是否相交,貌似很容易,直接用一个向量叉乘公式:x1*y2-x2*y1.如果结果为0,则直线是平行或者重合,否则必然相交...但如何判断两条线段是否相交呢?我们给出了两条线段的四个端点,这两条条线段必须跨过另一条线段则必然相交,所以只需要算出两个端点分别在一条线段的两侧就OK了,至于怎么算是否在端点两侧还是用到上面的叉乘公式,两个端点的结果的积为负数,则在两侧,当然这里有种特殊情况需要处原创 2013-08-05 07:55:25 · 1845 阅读 · 0 评论 -
【无聊】判断一点是否在三角形内。(面积法)
判断一点是否在三角形内:假设三角形三个顶点 都知道三角形的面积可以是原创 2014-10-04 12:04:47 · 1323 阅读 · 0 评论 -
CSU1403: 三角形面积
1403: 三角形面积Time Limit: 1 Sec Memory Limit: 128 MB Special JudgeSubmit: 176 Solved: 62[Submit][Status][Web Board]Description给出三维空间上的三个点,计算以这三个点为顶点的三角形的面积。Input输入的第一行包原创 2014-10-16 20:17:23 · 1060 阅读 · 0 评论