09 2012 档案
摘要:题意:一个凸包丢失了一些点后,问是否可以用剩下的这些点唯一确定以前的凸包。解法:先求出这些点的凸包,然后判断每条边上是否至少有3个点(含顶点),如果有,那么可以唯一确定以前的凸包。View Code 1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 #include <iostream> 5 #include <algorithm> 6 #include <queue> 7 #include <vector> 8 #includ
阅读全文
摘要:1750. Pakhom and the GullyTime Limit: 1.0 secondMemory Limit: 64 MBPakhom stands at the point S and wants to reach the point T to buy the land there. But he noticed a gully, which represents a polyline ABC. What is the length of the shortest path Pakhom should walk if he doesn't want to fall int
阅读全文
摘要:给定一个多边形:如何求重心??三角形的重心是: (x1+x2+x3) / 3,(y1+y2+y3) / 3(质点系重心公式)一个由 N 个顶点( xi, yi)确定的不自交闭多边形的中心能如下计算:记号( xN, yN)与顶点( x0, y0)相同。多边形的面积为:多边形的中心由下式给出:推论过程:将多边形剖分成N个三角形,分别求出其重心和面积,这时可以想象,原来质量均匀分布在内部区域上,而现在质量仅仅分布在这N个重心点上(等假变换),这时候就可以利用刚才的质点系重心公式了。 不过,要稍微改一改,改成加权平均数,因为质量不是均匀分布的,每个质点代表其所在三角形,其质量就是该三角形的面积(有向面
阅读全文

浙公网安备 33010602011771号