摘要: http://poj.org/problem?id=1308并查集。1.不能有环,即只能有一个节点的入度为零 2.除根节点外,其余所有结点的入度必需为1 3.空树也是树 1 #include <stdio.h> 2 #include <string.h> 3 #include <stdlib.h> 4 #include <set> 5 #include <iterator> 6 using namespace std; 7 int father[10002]; 8 int degree[10002]={0}; 9 set<int 阅读全文
posted @ 2013-02-16 14:22 linyvxiang 阅读(295) 评论(0) 推荐(0) 编辑