mirror of https://github.com/cyp0633/homework.git
parent
51e240b5e2
commit
17ac94f962
|
@ -45,21 +45,18 @@ int main()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
childNum = childSet.size();
|
childNum = childSet.size();
|
||||||
for (int i = 0; i < childNum; i++) //或许并不应该这样做?
|
for (int i = 0; i < childNum; i++)
|
||||||
{
|
{
|
||||||
it = find(G[currPos].begin(), G[currPos].end(), reqSeq.front());
|
set<int>::iterator it = childSet.find(reqSeq.front());
|
||||||
if (it != G[currPos].end()) //存在此儿子
|
if (it == childSet.end())
|
||||||
{
|
|
||||||
visitSeq.emplace(reqSeq.front());
|
|
||||||
reqSeq.pop();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
printf("No");
|
printf("No");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
childSet.clear(); //清空儿子集合
|
visitSeq.emplace(reqSeq.front());
|
||||||
|
reqSeq.pop();
|
||||||
}
|
}
|
||||||
|
childSet.clear(); //清空儿子集合
|
||||||
}
|
}
|
||||||
printf("Yes");
|
printf("Yes");
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue