![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
计算几何——二维几何基础
Alex_McAvoy
想要成为渔夫的猎手
展开
-
松鼠聚会(洛谷-P3964)
题目描述草原上住着一群小松鼠,每个小松鼠都有一个家。时间长了,大家觉得应该聚一聚。但是草原非常大,松鼠们都很头疼应该在谁家聚会才最合理。每个小松鼠的家可以用一个点x,y表示,两个点的距离定义为点(x,y)和它周围的8个点(x-1,y)(x+1,y),(x,y-1),(x,y+1).(x-1,y+1),(x-1,y-1),(x+1,y+1),(x+1,y-1)距离为1。30%的数据,0...原创 2020-02-27 12:02:05 · 1895 阅读 · 0 评论 -
Arena Olympics(Gym-102267F)
Problem DescriptionKassandra is participating in the Arena Olympics of Sparta. In order to win the arena fight, she has to knockout all the other Nfighters.Being a computer scientist, she wanted...原创 2019-08-23 10:14:23 · 347 阅读 · 0 评论 -
Circle of Polygon(Gym-102267H)
Problem DescriptionA circumscribed circlecircumscribed circle of a polygon is the circle that passes through all the vertices of that polygon.Let's assume we have a regularregular polygon, we wan...原创 2019-08-22 19:03:44 · 502 阅读 · 0 评论 -
Robo-Footballer(CF-248C)
Problem DescriptionIt's a beautiful April day and Wallace is playing football with his friends. But his friends do not know that Wallace actually stayed home with Gromit and sent them his robotic s...原创 2019-08-12 11:14:45 · 210 阅读 · 0 评论 -
Keiichi Tsuchiya the Drift King(Gym-102028D)
Problem DescriptionDrifting is a driving style in which the driver uses the throttle, brakes, clutch, gear shifting and steering input to keep the car in a state of oversteer while manoeuvring from...转载 2019-08-23 19:11:29 · 516 阅读 · 0 评论 -
B君的圆锥(51Nod-1629)
题目B君要用一个表面积为S的圆锥将白山云包起来。B君希望包住的白山云体积尽量大,B君想知道体积最大可以是多少。注意圆锥的表面积包括底面和侧面。输入一行一个整数,表示表面积S。(1 <= S <= 10^9)输出一行一个实数,表示体积。输入样例8输出样例1.504506思路:已知圆锥表面积 S,最大体积 V=S*sqrt*(S/(72*...原创 2019-04-25 18:27:00 · 151 阅读 · 0 评论 -
Aladdin and the Optimal Invitation(LightOJ-1349)
Problem DescriptionFinally Aladdin reached home, with the great magical lamp. He was happier than ever. As he was a nice boy, he wanted to share the happiness with all people in the town. So, he wa...原创 2019-02-13 23:24:49 · 292 阅读 · 0 评论 -
Building A New Barn(POJ-3269)
Problem DescriptionAfter scrimping and saving for years, Farmer John has decided to build a new barn. He wants the barn to be highly accessible, and he knows the coordinates of the grazing spots of...原创 2018-06-26 21:07:00 · 1602 阅读 · 0 评论 -
数学 —— 计算几何 —— 平面分割问题
【直线分平面问题】问题:n条直线,最多可以把平面分为多少个区域。解:当有n-1条直线时,平面最多被分成了f(n-1)个区域。则第n条直线要是切成的区域数最多,就必须与每条直线相交且不能有同一交点。 这样就会得到n-1个交点。这些交点将第n条直线分为2条射线和n-2条线段。而每条射线和线段将以有的区域一分为二。这样就多出了2+(n-2)个区域。如图:第四条红色的线与其他3条线生成了3...转载 2018-04-25 19:51:57 · 2312 阅读 · 0 评论 -
处女座的签到题
【题目描述】平面上有n个点,问:平面上所有三角形面积第k大的三角形的面积是多少?【输入描述】第一行T,表示样例的个数。对于每一组样例,第一行两个整数n和k,接下来n行,每行两个整数x,y表示点的坐标T<=803<=n<=100-10^9<=x,y<=10^9对于每一组样例,保证任意两点不重合,且能构成的三角形的个数不小于k【输...原创 2019-03-14 19:47:19 · 297 阅读 · 0 评论 -
计算几何 —— 二维几何基础
【理论】1.距离度量方法:点击这里2.三角形的面积:点击这里3.平面分割问题:点击这里【例题】Building A New Barn(POJ-3269)(曼哈顿距离):点击这里 Aladdin and the Optimal Invitation(LightOJ-1349)(曼哈顿距离+中位数):点击这里 处女座的签到题(2019牛客寒假算法基础集训营 Day2-A)(三角...原创 2019-01-25 21:58:07 · 257 阅读 · 0 评论 -
计算几何 —— 二维几何基础 —— 距离度量方法
【概述】在数据挖掘中,经常需要计算样本之间的相似度,通常做法是计算样本之间的距离。比如判断 A、B、C 三种商品之间的相似性,可以先按照商品特征构建 A、B、C 各自的向量,然后求向量间的距离,距离近就表示彼此相似度高。【曼哈顿距离】曼哈顿距离又称马氏距离(Manhattan distance),想象在曼哈顿街道上,从一个十字路口开车到另一个十字路口,驾驶距离就是这个“曼哈顿距...转载 2018-10-29 22:26:56 · 2023 阅读 · 0 评论 -
计算几何 —— 二维几何基础 —— 三角形的面积
【海伦公式】在平面内,有一个三角形,设其三边长分别为 a、b、c,面积为 S ,则有:其中,double calculate(double a,double b,double c){ double p=(a+b+c)/2; return sqrt( p*(p-a)*(p-b)*(p-c) );}【通过叉积】对于按逆时针转的三个点 A(x1,y1),B(x2...转载 2019-01-25 21:54:00 · 1010 阅读 · 0 评论