交了两天的半平面交的模版题终于过了,,,原来是 OnLeft 里面少抄了一个等于号......
半平面交 poj3335
1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include <string> 10 #include 11 #include 12 #include 13 #include <set> 14 #define LL long long 15 #define INF 0x3f3f3f3f 16 #define eps 1e-10 17 #define OPEN_FILE 18 using namespace std; 19 int n; 20 21 int dcmp(double x){ 22 if (fabs(x) return
凸包加旋转卡壳 poj2187
1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include <string> 10 #include 11 #include 12 #include 13 #include <set> 14 #define LL long long 15 #define INF 0x3f3f3f3f 16 #define OPEN_FILE 17 using namespace std; 18 19 #define eps 1e-8 20 21 struct Point{ 22 int x, y; 23 Point(int p = 0, int q = 0){ 24 x = p; 25 y = q; 26 } 27 }; 28 typedef Point Vector; 29 30 Vector operator + (Vector A, Vector B){ 31 return Vector(A.x + B.x, A.y + B.y); 32 } 33 Vector operator - (Vector A, Vector B){ 34 return Vector(A.x - B.x, A.y - B.y); 35 } 36 Vector operator * (Vector A, int p){ 37 return Vector(A.x * p, A.y * p); 38 } 39 Vector operator / (Vector A, int p){ 40 return Vector(A.x / p, A.y / p); 41 } 42 bool operator == (Vector A, Vector B){ 43 return A.x - B.x == 0 && A.y - B.y == 0; 44 } 45 bool operator > (Vector A, Vector B){ 46 return A.x > B.x ||(A.x == B.x && A.y > B.y); 47 } 48 bool operator <(Vector A, Vector B){ 49 return A.x B.y);