摘要: 判定是否成环,是否只有一个根,是否为空.代码如下:#include <cstdlib>#include <cstdio>#include <cstring>#include <algorithm>#include <map>#define MAXN 100000using namespace std;int stk[MAXN+5], top, flag;int set[MAXN+5];map<int,int>mp;void init(){ for (int i = 1; i <= MAXN; ++i) set[i] 阅读全文
posted @ 2011-05-11 22:27 沐阳 阅读(711) 评论(1) 推荐(0) 编辑