上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 42 下一页
摘要: 题意:给定一些cell 和 他们的xyz坐标 半径r求把所有的cell连接起来的最小花费prim。View Code 1 #include<stdio.h> 2 #include<string.h> 3 #include<math.h> 4 #include<queue> 5 using namespace std; 6 const int maxn = 105; 7 const int maxm = 20005; 8 const double inf = 99999999; 9 double mat[ maxn ][ maxn ];10 str 阅读全文
posted @ 2013-03-16 17:24 xxx0624 阅读(467) 评论(0) 推荐(0) 编辑
摘要: 题意:给定一些节目单的时间,求最多能看完整的节目数。把这些节目当成点,若下一个节目在上一个节目时间之后 则连上一条有向边 最后枚举起点求最长路。。。。View Code 1 #include<stdio.h> 2 #include<algorithm> 3 #include<queue> 4 using namespace std; 5 const int maxn = 105; 6 const int maxm = 10005; 7 const int inf = 99999999; 8 struct node{ 9 int s,t;10 };11 nod 阅读全文
posted @ 2013-03-16 16:56 xxx0624 阅读(225) 评论(0) 推荐(0) 编辑
摘要: 题意:求多边形面积。首先 对于两个向量 P,Q。P * Q = 1/2*area;以原点作为每条向量边的起始点,然后在遍历一遍所有的点,得到res这样在算面积的时候 多余的部分会在计算过程中 正负抵消 so 能得到sum_areaView Code 1 #include<stdio.h> 2 #include<math.h> 3 const int maxn = 105; 4 int n; 5 struct node{ 6 int x,y; 7 }a[ maxn ]; 8 9 double cross( node a,node b ){10 return 1.0*a.x 阅读全文
posted @ 2013-03-16 15:47 xxx0624 阅读(268) 评论(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; 14 typedef long lo 阅读全文
posted @ 2013-03-15 21:24 xxx0624 阅读(279) 评论(0) 推荐(0) 编辑
摘要: 题意;给定一个圆台杯子的R,r,H和里面水的体积V求h二分。。。。。。。。。。。。。。。。。因为解不出来h。。。。。。。。。。。。View Code 1 /* 2 几何 3 圆台体积 4 V=1/3*pi*h*(r1*r1+r2*r2+r1*r2) 5 6 */ 7 #include<stdio.h> 8 #include<string.h> 9 #include<stdlib.h>10 #include<algorithm>11 #include<iostream>12 #include<queue>13 //#incl 阅读全文
posted @ 2013-03-15 17:27 xxx0624 阅读(258) 评论(0) 推荐(0) 编辑
摘要: 题意 解法 见代码View Code 1 /* 2 几何 3 给定n个普通的点,m个gold点 4 求某个多边形面积和这个多边形的gold数的比值的最小值 5 三角形内点数=|sum(i,k)+sum(j,k)-sum(i,k)|; 6 */ 7 #include<stdio.h> 8 #include<string.h> 9 #include<stdlib.h>10 #include<algorithm>11 #include<iostream>12 #include<queue>13 //#include<map 阅读全文
posted @ 2013-03-15 16:36 xxx0624 阅读(242) 评论(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<stack>12 #include<math.h>13 #include<map>14 using namespace std;15 con 阅读全文
posted @ 2013-03-10 13:51 xxx0624 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 水~分析:n,m。对于第一个人不抽到m号座位概率为(n-1)/n,第二个人为(n-2)/(n-1).。。。第m个人为1/(n-m+1).。。。相乘之后则为 1/nView 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<stack>11 #include& 阅读全文
posted @ 2013-03-10 12:50 xxx0624 阅读(394) 评论(0) 推荐(0) 编辑
摘要: 水题~~~View Code 1 /* 2 C(N,M) 3 */ 4 #include<stdio.h> 5 #include<string.h> 6 #include<stdlib.h> 7 #include<algorithm> 8 #include<iostream> 9 #include<queue>10 #include<stack>11 #include<math.h>12 #include<map>13 typedef __int64 int64;14 using nam 阅读全文
posted @ 2013-03-10 11:50 xxx0624 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 题意:给定一张无向图,求最小的奇数环。注意:状态的设定 vis[ i ][ 0 ] and vis[ i ][ 1 ] 很重要!!!View Code 1 /* 2 BFS+最小奇数环 3 */ 4 #include<stdio.h> 5 #include<string.h> 6 #include<stdlib.h> 7 #include<algorithm> 8 #include<iostream> 9 #include<queue>10 #include<stack>11 #include<math. 阅读全文
posted @ 2013-03-10 11:29 xxx0624 阅读(518) 评论(0) 推荐(0) 编辑
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 42 下一页