摘要:
```cpp //P2002解题思路: //先求SCC,缩点后,转换为DAG(有向无环图) //在DAG上统计入度为0的scc数量即可 //Tarjan时间复杂度:O(N+E),每个点和每条边刚好被访问一次,在空间和时间上比Kosaraju好一些。 include include include i 阅读全文
摘要:
```cpp //P2002解题思路: //先求SCC,缩点后,转换为DAG(有向无环图) //在DAG上统计入度为0的scc数量即可 //Kosaraju时间复杂度:O(N+E) //两次DFS,2N,图的转置E,共2N+E include include include include usin 阅读全文