这题好像是DEF里最水的,, /* 建图:如果a认识b,那么从a->b连一条边,将点分成两个集合A,B,没有从A->B的边 求出强连通分量,再造一张新图,新图中任取一个的出度为0的点作为集合A即可 */ #include<bits/stdc++.h> using namespace std; #define N 2000005 ]; int head[N],tot,n,m; int c[N],out[N],cnt;//新图的点个数,每个点的出度 int ind,dfn[N],low…
Summer Holiday Time Limit: 10000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4574 Accepted Submission(s): 2078 Problem Description To see a World in a Grain of Sand And a Heaven in a Wild Flower, Hold Inf…
Road Networks Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status Practice UVALive 4262 Description There is a road network comprised by M<tex2html_verbatim_mark> roads and N<tex2html_verbatim_mark> citie…
https://www.luogu.org/problem/P2341 #include<cstdio> #include<cstring> #include<algorithm> using namespace std; ; int pre[maxn],other[maxn],last[maxn],l; int n,m; int dfn[maxn],low[maxn],ans[maxn],st[maxn],belong[maxn],cnt,top,qw; //dfn-…