n只有2000,直接DFS就可以过了... -------------------------------------------------------------------------- #include<cstdio> #include<cstring> #include<algorithm> #include<iostream> #include<cctype> #define rep( i, n ) for( int i = 0;…
tarjan缩点后拓扑排序,每一个点用一个bitset记录哪些点能到达它. PS:数据太水,暴力能过. #include<bits/stdc++.h> using namespace std; #define N 2010 struct edge{ edge* s; int v; }e[N*N*2],*back=e,*h[N]; int low[N],num[N],scc[N],size[N]; int now; void tarjan(int u){ static int cnt; stat…