摘要:
1 /* 2 * 凸包 3 * 注意:给出的点为整点数,不要设某一精度值! 4 */ 5 6 #include <cmath> 7 #include <cstdio> 8 #include <cstdlib> 9 #include <iostream>10 11 using namespace std;12 13 const int N = 1005;14 const double PI = 3.1415927;15 16 struct point {17 double x;18 double y;19 }p[N], stack[N];20 21 阅读全文
posted @ 2012-04-24 22:34
Try86
阅读(936)
评论(0)
推荐(0)
摘要:
1 /* 2 * 题目要求:对一组向量按与x轴的正向夹角从小到大排序 3 * 解法:借用求凸包的排序规则即可 4 */ 5 6 #include <cmath> 7 #include <cstdio> 8 #include <cstdlib> 9 #include <iostream>10 11 using namespace std;12 13 const int N = 105;14 const double eps = 1e-8;15 16 struct point {17 double x;18 double y;19 }p[N];20 阅读全文
posted @ 2012-04-24 22:07
Try86
阅读(286)
评论(0)
推荐(0)
摘要:
1 /* 2 * 题目要求:判断给出的一些折线段是否相交 3 * 解法:枚举每条折线段上的每段线段,判断其是否与其它折线段的线段相交 4 */ 5 6 #include <cstdio> 7 #include <cstdlib> 8 #include <iostream> 9 10 using namespace std;11 12 const int N = 35;13 const int M = 105;14 15 int num[N];16 struct point {17 double x;18 double y;19 }p[N][M];20 21 阅读全文
posted @ 2012-04-24 21:34
Try86
阅读(429)
评论(0)
推荐(0)
摘要:
1 /* 2 * 题目要求:求三角形的最大面积 3 * 方法:凸包+枚举凸包上的点 4 */ 5 6 #include <cmath> 7 #include <cstdio> 8 #include <cstdlib> 9 #include <iostream>10 11 using namespace std;12 13 const int N = 50005;14 const double eps = 1e-8;15 16 struct point {17 int x;18 int y;19 }p[N], stack[N];20 21 bool 阅读全文
posted @ 2012-04-24 18:53
Try86
阅读(664)
评论(0)
推荐(0)