本文主要是介绍多校第八场:几何+图论出度+模拟+找规律,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
HDU 4946 Area of Mushroom
这题WA了7发才过,队友做的,然后一起debug了好久。
刚开始是没排序。
然后是在同一个位置的点没有处理好。
然后把这两个问题搞定就A了。
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ctype.h>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define eps 1e-10
#define INF 0x7fffffff
#define maxn 10005
#define PI acos(-1.0)
#define seed 31//131,1313
typedef long long LL;
typedef unsigned long long ULL;
using namespace std;
int x[505],y[505],v[505],vis[505];
int cmp(double x)
{if(fabs(x)<eps)return 0;if(x>0)return 1;return -1;
}
inline double sqr(double x)
{return x*x;
}
struct point//点
{double x,y;int pos;int o;point() {}point(double a,double b):x(a),y(b) {}void input(){scanf("%lf%lf",&x,&y);}friend point operator + (const point &a,const point &b){return point(a.x+b.x,a.y+b.y);}friend point operator - (const point &a,const point &b){return point(a.x-b.x,a.y-b.y);}friend bool operator == (const point &a,const point &b){return cmp(a.x-b.x)==0 &&cmp(a.y-b.y)==0;}friend point operator * (const point &a,const double &b){return point(a.x*b,a.y*b);}friend point operator * (const double &a,const point &b){return point(a*b.x,a*b.y);}friend point operator / (const point &a,const double &b){return point(a.x/b,a.y/b);}double norm(){return sqrt(sqr(x)+sqr(y));}//到原点距离void out () const{printf("%.2f %.2f",x,y);}
} p[505];
double det (const point &a,const point &b)
{return a.x*b.y-a.y*b.x;
}//叉积
double dot (const point &a,const poi
这篇关于多校第八场:几何+图论出度+模拟+找规律的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!