计算几何
Rocky0429
我愿能朝着太阳生长,做一个温暖的人。
展开
-
Intersecting Lines(计算几何_直线与直线)
DescriptionWe 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 intersection because they are paralle原创 2014-08-14 12:59:54 · 1303 阅读 · 0 评论 -
NYOJ 7-街区最短路径问题(曼哈顿距离)
题目地址:NYOJ 7曼哈顿距离:两点在南北方向上的距离加上在东西方向上的距离,即d(i,j)=|xi-xj|+|yi-yj|。对于一个具有正南正北、正东正西方向规则布局的城镇街道,从一点到达另一点的距离正是在南北方向上旅行的距离加上在东西方向上旅行的距离。思路:因为只能东西和南北方向走,所以先把南北(X)和东西(Y)方向的坐标分开,分别求它们的最值,然后相加即可。分析可以得知,邮局的所建原创 2015-07-09 17:09:21 · 6308 阅读 · 0 评论 -
POJ 1265-Area(计算几何+皮克定理+多边形面积公式)
题目地址:POJ 1265题意:给定一个格点多边形,求出内部点数in,边上点数on,和面积S。思路:运用的定理很多。1.皮克定理:S=in+on/2-1,即in=(2*S+2-on)/2。2.多边形的面积公式:按顺序求相邻两个点与原点组成的向量的叉积之和。3.求边上的格点数:以格子点为顶点的线段,覆盖的点的个数为GCD(dx,dy),其中,dxdy分别为线段横向占的点数和纵向占原创 2015-06-08 14:28:03 · 2084 阅读 · 0 评论 -
POJ 2954-Triangle(计算几何+皮克定理)
题目地址:POJ 2954题意:给出三角形的三个顶点,求内部格点的个数。思路:形同POJ 1265。#include #include #include #include #include #include #include #include #include #include #include using namespace std;typedef long原创 2015-06-08 14:44:29 · 2021 阅读 · 0 评论 -
POJ 1905-Expanding Rods(二分+计算几何)
题目地址:POJ 1905题意:一根某种材料做的直杆被夹在两面墙之间,当他受热时长度变长,就会因两面墙的挤压而向上隆起。长度变化函数为 L'=(1+n*C)*L,给定L,C,n,求向上拱起的高度H。思路:手动计算出这两个公式,然后用二分查找h值。#include #include #include #include #include #include #includ原创 2015-06-04 08:05:23 · 1544 阅读 · 0 评论 -
HDU 5251-矩形面积(点集的最小面积包围矩形)
矩形面积Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 127 Accepted Submission(s): 69Problem Description小度熊有一个桌面,小度熊剪了很多矩形放在桌面上,原创 2015-05-31 17:25:32 · 2683 阅读 · 0 评论 -
UVA 11796- Dog Distance(计算几何_求最大距离和最小距离之差)
题意:甲乙两条狗分别沿着一条折线奔跑,两只狗的速度未知,但已知他们同时出发,同时到达,并且都是匀速奔跑,试求甲和乙在奔跑过程中最远距离和最近距离之差。思路:因为运动是相对的,因此也可以认为甲静止不动,乙自己沿着直线走,因此问题转化为求点到线段的最小或最大距离。然后模拟求解。大白P262#include #include #include #include #include原创 2015-05-17 11:54:42 · 1907 阅读 · 0 评论 -
POJ 2284-That Nice Euler Circuit(计算几何_欧拉定理求平面被分成的区域数)
That Nice Euler CircuitTime Limit:3000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uSubmit Status Practice POJ 2284Appoint description: System Crawler (2015-05-16)原创 2015-05-16 18:01:57 · 1412 阅读 · 0 评论 -
UVA 11178-Morley's Theorem(计算几何_莫雷定理)
Problem DMorley’s TheoremInput: Standard InputOutput: Standard Output Morley’s theorem states that that the lines trisecting the angles of an arbitrary plane triangle meet at the vertices of a原创 2015-05-16 16:58:07 · 1831 阅读 · 0 评论 -
UVA 270-Lining Up(多点共线)
Lining UpTime Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %lluSubmit StatusDescription Lining Up ``How am I ever going to solve this prob原创 2015-02-06 11:07:15 · 1433 阅读 · 0 评论 -
Pick-up sticks(计算几何_线段相交)
DescriptionStan 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 sticks, that is these sticks such th原创 2014-08-16 16:07:18 · 1890 阅读 · 1 评论 -
You can Solve a Geometry Problem too(计算几何_求线段相交)
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 problems ar原创 2014-08-13 17:11:06 · 1663 阅读 · 0 评论 -
HDU 5365-Run(几何)
题目地址:HDU 5365 题意: 问题描述 小花是一个热爱健身的姑娘,这天她下载了一个跑步软件,这个软件可以记录下小花跑步的轨迹。小花决定去公园跑步。公园里有许许多多的座椅,小花希望在一些座椅休息一下,并且她在两条座椅之间只跑直线。小花是一个完美主义者,她希望自己最后的轨迹是一个正三边形或者正四边形或者正五边形或者正六边形。小花会从某条座椅开始打开跑步软件,并在回到这个座椅后关闭。 请问小原创 2015-08-09 16:31:53 · 1319 阅读 · 1 评论