摘要:
判定是否成环,是否只有一个根,是否为空.代码如下:#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] 阅读全文