上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 42 下一页
摘要: 先算重心!!!!!!再算凸包!!!!!!!View Code 1 /* 2 几何+重心 3 */ 4 #include<stdio.h> 5 #include<string.h> 6 #include<stdlib.h> 7 #include<algorithm> 8 #include<iostream> 9 #include<queue> 10 //#include<map> 11 #include<math.h> 12 using namespace std; 13 typedef long l 阅读全文
posted @ 2013-03-19 20:22 xxx0624 阅读(439) 评论(0) 推荐(0) 编辑
摘要: 详见代码View Code 1 /* 2 几何+线段相交 3 */ 4 #include<stdio.h> 5 #include<string.h> 6 #include<stdlib.h> 7 #include<algorithm> 8 #include<iostream> 9 #include<queue>10 //#include<map>11 #include<math.h>12 using namespace std;13 typedef long long ll;14 //typedef 阅读全文
posted @ 2013-03-19 18:27 xxx0624 阅读(249) 评论(0) 推荐(0) 编辑
摘要: View Code 1 /* 2 几何+判断凸多边形 3 */ 4 #include<stdio.h> 5 #include<string.h> 6 #include<stdlib.h> 7 #include<algorithm> 8 #include<iostream> 9 #include<queue>10 //#include<map>11 #include<math.h>12 using namespace std;13 typedef long long ll;14 //typedef _ 阅读全文
posted @ 2013-03-19 14:43 xxx0624 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 详见代码View Code 1 /* 2 几何+判定点是否在多边形内 3 */ 4 #include<stdio.h> 5 #include<string.h> 6 #include<stdlib.h> 7 #include<math.h> 8 const int maxn = 105; 9 const double eps = 1e-8;10 const int inf = 99999999;11 const int max_x = 1000;12 const int max_y = 1000;13 struct point{14 double 阅读全文
posted @ 2013-03-19 14:11 xxx0624 阅读(342) 评论(0) 推荐(0) 编辑
摘要: 这是按照自己理解写的一个测试代码。。。简单易懂#include<stdio.h>#include<string.h>#include<stdlib.h>const int maxn = 10005;int a[ maxn ],c[ maxn ];int lowbit( int i ){ return i&(-i);}int sum( int i ){ int s=0; while( i>0 ){ s+=c[ i ]; i-=lowbit( i ); } return s;}void update( int i,int new_val,int p 阅读全文
posted @ 2013-03-19 10:38 xxx0624 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 题意:怎样改动得到一个beautiful数。。。枚举!!!View Code 1 /* 2 sort+bruce 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include10 //#include11 #include12 using namespace std;13 typedef long long ll;14 //typedef __int64 int64;15 const int maxn = 10005;16 const int inf = 0x7fffffff;17 const double pi. 阅读全文
posted @ 2013-03-17 20:27 xxx0624 阅读(292) 评论(0) 推荐(0) 编辑
摘要: 题意:给定一个多边形,让你求出其价值。价值的定义是:-p*凹面的个数+q*凸面的个数。。。。(其实参照了这个博客,才理解题意。。。。http://blog.csdn.net/juststeps/article/details/8666769)凸面的个数就是凸包中的点的个数,但是当出现凹面时,就会减少一个凸面,这是因为这时候的凸面是虚拟出来的!!!!!View Code 1 /* 2 凸包 3 */ 4 #include<stdio.h> 5 #include<string.h> 6 #include<stdlib.h> 7 #include<algor 阅读全文
posted @ 2013-03-17 19:11 xxx0624 阅读(562) 评论(0) 推荐(0) 编辑
摘要: 题意:给定两个数组,求由第一个数组到第二个数组的操作方法数 和 步骤(只能相邻间交换)暴力+模拟View Code 1 /* 2 3 */ 4 #include 5 #include 6 #include 7 #include 8 #include 9 #include10 //#include11 #include12 using namespace std;13 typedef long long ll;14 //typedef __int64 int64;15 const int maxn = 305;16 const int inf = 0x7fffffff;17 const do.. 阅读全文
posted @ 2013-03-17 14:44 xxx0624 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 题意:给定一些点,求最大三角形面积View Code 1 /* 2 凸包+最大三角形面积 3 */ 4 #include<stdio.h> 5 #include<string.h> 6 #include<stdlib.h> 7 #include<algorithm> 8 #include<iostream> 9 #include<queue>10 //#include<map>11 #include<math.h>12 using namespace std;13 typedef long long 阅读全文
posted @ 2013-03-17 11:30 xxx0624 阅读(276) 评论(0) 推荐(0) 编辑
摘要: 题意:给定一些点,求最远的点的距离。凸包+旋转卡壳View Code 1 /* 2 旋转卡壳 3 凸包中的点为顺时针存储 4 */ 5 #include<stdio.h> 6 #include<string.h> 7 #include<stdlib.h> 8 #include<algorithm> 9 #include<iostream> 10 #include<queue> 11 //#include<map> 12 #include<math.h> 13 using namespace std; 阅读全文
posted @ 2013-03-17 10:58 xxx0624 阅读(328) 评论(0) 推荐(0) 编辑
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 42 下一页