上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 25 下一页
摘要: 题意:给出中点求顶点(结合样例的图)。顶点个数是奇数题解:很容易想到高斯消元,然后他为什么强调是奇数?随便找一个奇数个点的多边形一推导,就可以直接推出其中一个待求点的坐标,然后即推算就可以了。偶数时就不行了。。。View Code 1 #include <iostream> 2 #include <cstdlib> 3 #include <cstdio> 4 #include <cstring> 5 #include <algorithm> 6 #include <cmath> 7 8 #define N 1010 9 1 阅读全文
posted @ 2013-02-24 20:11 proverbs 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 题意:一根细杆长为l,能够压弯成为一段长为(1+n*c)*l 的圆弧。给出l, n, c的值,求出杆变形后,中间升高的距离h题解:二分圆心到细杆的距离,然后算出弧长,判断当前二分值的大小是否合适即可View Code 1 #include <iostream> 2 #include <cstdio> 3 #include <cstdlib> 4 #include <cstring> 5 #include <algorithm> 6 #include <cmath> 7 8 #define PI 3.141592653589 阅读全文
posted @ 2013-02-24 20:06 proverbs 阅读(200) 评论(0) 推荐(0) 编辑
摘要: 求多边形周长。角都是直角。View Code 1 #include <iostream> 2 #include <cstring> 3 #include <cstdio> 4 #include <cstdlib> 5 #include <algorithm> 6 7 #define N 222222 8 9 using namespace std;10 11 struct PO12 {13 int x,y;14 }p[N];15 16 int n;17 18 inline bool cmpx(const PO &a,const 阅读全文
posted @ 2013-02-24 20:03 proverbs 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 模板题。View Code 1 #include <iostream> 2 #include <cstring> 3 #include <cstdio> 4 #include <cstdlib> 5 #include <algorithm> 6 7 #define N 1000010 8 9 using namespace std;10 11 struct PO12 {13 int x,y;14 }p[N];15 16 char str[N];17 int n;18 int dx[10]={0,-1,0,1,-1,0,1,-1,0,1 阅读全文
posted @ 2013-02-24 19:03 proverbs 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 题意:问第二个矩形能不能放进第一个矩形中。题解:暴力旋转第二个矩形,判断左右、上下是否同时小于第一个矩形当然,数学推导也可以,挺简单的相似神马的胡搞就行~View Code 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <cstdlib> 5 #include <algorithm> 6 #include <cmath> 7 8 #define PI 3.141592653589793 9 #define EPS 1e-7 阅读全文
posted @ 2013-02-24 19:02 proverbs 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 题意:求多边形内部整点的个数、边上整点数、多边形的面积(点数指正点数)题解:[Pick定理] 设以整数点为顶点的多边形的面积为S, 多边形内部的整数点数为N, 多边形边界上的整数点数为L, 则 N + L/2 - 1 = SView Code 1 #include <iostream> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cstdio> 5 #include <algorithm> 6 #include <cmath> 7 8 #define N 22 阅读全文
posted @ 2013-02-24 19:00 proverbs 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 题意:这里讲的很清楚:http://www.cnblogs.com/xdruid/archive/2012/06/20/2555536.html我们一般的凸包模板都是最简的,而稍作变化就能做到“最繁”的~View Code 1 #include <iostream> 2 #include <cstring> 3 #include <cstdlib> 4 #include <algorithm> 5 #include <cstdio> 6 #include <cmath> 7 8 #define N 2222 9 10 us 阅读全文
posted @ 2013-02-24 18:54 proverbs 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 题解:把横坐标离散化,然后把矩形拆成上下两条边,上边标成-1,下边标成1,然后按情况增减面积即可~View Code 1 #include <iostream> 2 #include <cstring> 3 #include <cstdio> 4 #include <cstdlib> 5 #include <algorithm> 6 7 #define N 222 8 9 using namespace std;10 11 struct LI12 {13 double y,sx,tx;14 int nsx,ntx,fg;15 }li[ 阅读全文
posted @ 2013-02-24 18:51 proverbs 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 题解:好题,计算几何的好题就是数据好!然我找到了不规范相交的模板~简单多边形用不规范相交搞,然后面积随便选用每条边(边是逆时针方向的)的端点和原点做叉积,就是面积(取绝对值)~View Code 1 #include <iostream> 2 #include <cstring> 3 #include <cstdio> 4 #include <cstring> 5 #include <algorithm> 6 #include <cmath> 7 8 #define N 22222 9 #define EPS 1e-710 阅读全文
posted @ 2013-02-24 00:57 proverbs 阅读(304) 评论(0) 推荐(0) 编辑
摘要: 题意:分为两种点,求两种点之间的平面最近点对题解:分治法。这个怎么暴力分治都能过。。吐槽:我用了g++ tle+wa,毛线。。。View Code 1 #include <iostream> 2 #include <cstring> 3 #include <cstdlib> 4 #include <cstdio> 5 #include <algorithm> 6 #include <cmath> 7 8 #define N 222222 9 #define EPS 1e-710 #define INF 1e1511 12 阅读全文
posted @ 2013-02-23 22:32 proverbs 阅读(826) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 25 下一页