2013年3月19日

NYOJ 42 一笔画问题

摘要: 1 #include<stdio.h> 2 #include<string.h> 3 #include<stdlib.h> 4 int father[1005]; 5 int degree[1005]; 6 int find(int x) 7 { 8 if(x!=father[x]) 9 father[x]=find(father[x]);10 return father[x];11 }12 void merge(int x,int y)13 {14 x=find(x);15 y=find(y);16 if(x!=y)17 ... 阅读全文

posted @ 2013-03-19 14:59 小花熊 阅读(920) 评论(0) 推荐(0) 编辑

NYOJ3 3 多边形重心问题

摘要: #include<stdio.h>#include<math.h>#include<string.h>#include<stdlib.h>struct Point{ double x; double y;}point[10010];int i,n,m;int main(){ scanf("%d",&n); while(n--){ scanf("%d",&m); double tmp,area=0,x=0,y=0; for(i=0;i<m;i++) scanf("%lf%lf& 阅读全文

posted @ 2013-03-19 11:11 小花熊 阅读(199) 评论(0) 推荐(0) 编辑

导航