The Fortified Forest(暴力状态枚举+凸包)

太爽了!!!!1A

#include 
#include 
#include 
#include 

using namespace std;


const int maxn=50;
const double eps=1e-8;

int sgn(double x)
{
    if(fabs(x)0&&((p1[Stack[top]]-p1[Stack[top-1]])^(p1[i]-p1[Stack[top-1]]))<=0)
                top--;
            top++;
            Stack[top]=i;
        }
    }
}

double getsa()
{
    double res=0;
    for(int i=1;i<=top;i++)
    {
        res+=dist(p1[Stack[i]],p1[Stack[i-1]]);
    }
    res+=dist(p1[Stack[top]],p1[0]);
    return res;
}

int main()
{

    int n;
    int Num=0;
    while(1)
    {
        cin>>n;
        if(n==0)
            break;
        Num++;
        for(int i=0;i>p[i].x>>p[i].y>>p[i].val>>p[i].len;
            p[i].index=i+1;
        }
        int max1=100000000;
        int ans[maxn];
        int ans_cont=0;
        double ans_s;
        for(int i=0;i<(1<>1;
            }
            if(p1_cont==0)
                continue;
            graham();
            double s=getsa();
            if(len>=s)
            {
                if(val

 

你可能感兴趣的:(计算几何)