终于能自己完整的打下来
#include#include #include #include #include using namespace std;const int maxn=2020;bool isins[maxn];int low[maxn],dfn[maxn];int zhan[maxn],top=0;vector tu[maxn];vector lt[maxn];int lts=0;int js=0,n,m;void tarjan(int i){ int j; dfn[i]=low[i]=++js; isins[i]=1; zhan[top++]=i; for(j=0;j >n>>m; for(int i=1;i<=m;i++) { int a,b; cin>>a>>b; tu[a].push_back(b); } solve(n); for(int i=1;i<=lts;i++) { cout< <<":"; for(int j=0;j