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) 编辑