摘要: 纯水题,注意交点不一定是第二个点和第三个点#include<stdio.h>#include<string.h>#include<stdlib.h>#include<math.h>#include<algorithm>using namespace std;struct Vector{ double x; double y;};struct point{ double x; double y;};Vector operator-(const point a,const point b){ Vector temp; temp.x=a.x 阅读全文
posted @ 2012-07-23 21:24 willzhang 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 看错题意,白贡献了4个RE#include<stdio.h>#include<string.h>#include<stdlib.h>#include<math.h>__int64 parent[31000];__int64 total[31000];__int64 under[31000];__int64 getparent(__int64 x){ if(parent[x]==x) { return x; } __int64 t=getparent(parent[x]); under[x]+=under[parent[x]]; parent[x. 阅读全文
posted @ 2012-07-23 10:37 willzhang 阅读(192) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h>#include<string.h>#include<stdlib.h>#include<math.h>#include<algorithm>int parent[30010];int total[30010];using namespace std;int getparent(int s){ if(parent[s]==s) { return s; } return parent[s]=getparent(parent[s]);}void Merge(int a,int b){ int m,n; m 阅读全文
posted @ 2012-07-23 09:33 willzhang 阅读(116) 评论(0) 推荐(0) 编辑