现在的位置: 首页 > 综合 > 正文

计算几何的题目

2019年09月07日 ⁄ 综合 ⁄ 共 1069字 ⁄ 字号 评论关闭

 hdu 1086 You can Solve a Geometry Problem too:判断有几个交点

 hdu 1115 Lifting the Stone:求多边形的重心坐标

 hdu 1147 Pick-up sticks:判断直线是否相交

 

struct P
{
    double x, y;
};
struct Line
{
    P s, e;
};
int dblcmp(double b)
{
    if (fabs(b)<pre)
        return 0;
    return b > 0 ? 1 : -1;
}
int cross(P a, P b, P c)
{
    double x1 = a.x - c.x;
    double y1 = a.y - c.y;
    double x2 = b.x - c.x;
    double y2 = b.y - c.y;
    return x1 * y2 - x2 * y1;
}
int segcrossSimple(Line a, Line b)//判断是否相交
{
    int x1 = dblcmp(cross(a.s, a.e, b.s));
    int x2 = dblcmp(cross(a.s, a.e, b.e));
    int y1 = dblcmp(cross(b.s, b.e, a.s));
    int y2 = dblcmp(cross(b.s, b.e, a.e));
    return (x1*x2<=0) && (y1*y2<=0);
}

 hdu 1392 Surround the Trees:多大的周长可以把所有的树包含进来,即计算凸包的周长

 hdu 1348 Wall:计算凸包的周长加上圆的周长

 hdu 1466 计算直线的交点数 (有公式)

 hdu 4709 Herding:求最小三角形的面积

 hdu 2108 Shape of HDU

 hdu 1173 采矿 (求中位数)

 hdu 2036 改革春风吹满地

 hdu 2202 最大三角形:直接暴力的方法会超时,先计算凸包,然后再计算面积。

 hdu 1071 The area

 已知一条直线与抛物线的两个交点a(x1, y1), b(x2, y2),以及抛物线上的一点c(x3, y3)求直线与抛物线围成的面积

 

  poj 2187 Beauty Contest :计算最远的两个点,凸包直径

  poj 3348 Cows :求凸包的面积

  poj 1118 Lining Up, poj 2606 Rabbit hunt, poj 2780 Linearity:在一条直线上的最多点数

  poj 1654 Area:计算多边形面积,注意方位,取值很大用__int64,结果为小数时保留小数点后5位

  poj 1151 :计算面积的并,用线段树

  poj 1408 Fishnet:用到线段的交点坐标, 多边形的面积计算

  hdu 1558 segment set:线段是否相交+并查集










抱歉!评论已关闭.