上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 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<vector>12 #include<math.h>13 using namespace std;14 typedef long l 阅读全文
posted @ 2013-04-01 21:22 xxx0624 阅读(316) 评论(0) 推荐(0) 编辑
摘要: 枚举支援的国家。。。View Code 1 /* 2 DFS 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 // 阅读全文
posted @ 2013-03-30 22:01 xxx0624 阅读(399) 评论(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-30 15:33 xxx0624 阅读(220) 评论(0) 推荐(0) 编辑
摘要: View Code 1 /* 2 几何+凸包逆序输出+极角排序 3 */ 4 #include<stdio.h> 5 #include<string.h> 6 #include<stdlib.h> 7 #include<math.h> 8 #include<algorithm> 9 using namespace std;10 const int maxn = 55;11 const double eps = 1e-8;12 struct Point{13 double x,y;14 };15 Point point[ maxn ]; 阅读全文
posted @ 2013-03-30 14:08 xxx0624 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 注意:不碰任何顶点-----(上下移动)>碰一个顶点-----(绕此顶点旋转)>碰两个顶点-----(绕前后两个顶点旋转)>碰上下各一个顶点其中:判断i,j是否被某壁阻挡,可通过判断是否与垂直线段相交判断!!!!!!!!!!View Code 1 /* 2 几何+直线相交+求交点 3 */ 4 #include<stdio.h> 5 #include<string.h> 6 #include<stdlib.h> 7 #include<algorithm> 8 using namespace std; 9 const int ma 阅读全文
posted @ 2013-03-28 19:12 xxx0624 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 注意:注意判断两点是否能相连,需要判断这两点之间是否含有其他的线段。。。同一列的墙 我用的是flag来标记。。View Code 1 /* 2 dij+两点间距离 3 */ 4 #include<stdio.h> 5 #include<string.h> 6 #include<stdlib.h> 7 #include<algorithm> 8 #include<iostream> 9 #include<math.h> 10 using namespace std; 11 12 const int maxn = 205;// 阅读全文
posted @ 2013-03-27 18:56 xxx0624 阅读(322) 评论(0) 推荐(0) 编辑
摘要: 题意:给定一些点,问是否能找到一条直线,使得这条直线与所有的线段都有交点因为n很小,所以可以枚举。当某条线段的两点在“直线”的一侧时,即不合题意。。。。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 #inc 阅读全文
posted @ 2013-03-27 16:37 xxx0624 阅读(280) 评论(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 using namespace std;10 const int maxn = 1005;11 const double eps = 1e-8;12 struct point 阅读全文
posted @ 2013-03-26 20:37 xxx0624 阅读(250) 评论(0) 推荐(0) 编辑
摘要: solve(a,b,c)=a^b%cView Code 1 /* 2 快速求幂 3 solve(a,b,c)==a^b%c 4 */ 5 #include 6 #include 7 #include 8 #include 9 #include10 #include11 #include12 using namespace std;13 typedef __int64 int64;14 const int maxn = 10005;15 const int64 mod = 1000000007;16 int64 a[ maxn ],b[ maxn ];17 int solve( int64 m. 阅读全文
posted @ 2013-03-26 19:41 xxx0624 阅读(259) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<string.h>const int maxn = 12;//the size of the mazeint a[ maxn ][ maxn ];const int dx[]={0,1,0,-1};const int dy[]={1,0,-1,0};bool inside( int x,int y,int n ){ if( x>=0&&x<n&&y>=0&&y<n ) return true; else return false;}int main 阅读全文
posted @ 2013-03-25 23:18 xxx0624 阅读(203) 评论(0) 推荐(0) 编辑
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 42 下一页