摘要: 题意:给定一些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) 编辑