模板题, 注意的一点,atan2在g++中会超时,在c++中却ac了
#include <iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<vector>
using namespace std;
#define db double
const db eps = 1e-10;
const int maxn = 3e4;
struct Point{
db x, y;
Point(db x=0, db y=0): x(x), y(y) {} //必须有初始化
bool operator < (const Point& p) const{
return x < p.x || (x == p.x && y < p.y);
}
};
typedef Point Vector;
Vector operator + (Vector a, Vector b){ return Point(a.x+b.x, a.y+b.y);}
Vector operator - (Point a, Point b){ return Vector(a.x-b.x, a.y-b.y);}
Vector operator * (Vector a, db k){ return Vector(a.x*k, a.y*k);}
Vector operator / (Vector a, db k){ return Vector(a.x/k, a.y/k);}
//inline将函数名为内联函数,不使用栈空间&