有向图缩点
题目描述
解题思路
强连通分量模板,用 T a r j a n Tarjan Tarjan 算法。
code
#include<iostream>
#include<cstdio>
#include<queue>
using namespace std;
queue<int> q;
int n,m;
int ans;
int tm,tt;
int a[10010];
int v[10010];
int f[10010];
int du[10010];
int dfn[10010];
int low[10010];
int num[10010];
int dui[10010],tp;
int hd[10010],tot;
int hd1[10010],tot1;
struct abc{
int to,next