void tarjan(int u) { dfn[u]=low[u]=++dfs_clock; stack_push(u); for (int c=head[u];c;c=nxt[c]) { int v=to[c]; if (!dfn[v]) { tarjan(v); low[u]=min(low[u],low[v]); } else if (!scc[v]) low[u]=min(low[u],dfn[v]); } if (low[u]==dfn[u]) { scc_cnt++; int cu
Proving Equivalences Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 3743 Accepted Submission(s): 1374 Problem Description Consider the following exercise, found in a generic linear algebra
Description Every cow's dream is to become the most popular cow in the herd. In a herd of N (1 <= N <= 10,000) cows, you are given up to M (1 <= M <= 50,000) ordered pairs of the form (A, B) that tell you that cow A thinks that cow B is popula
hdu1269 迷宫城堡 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 6081 Accepted Submission(s): 2694 Problem Description 为了训练小希的方向感,Gardon建立了一座大城堡,里面有N个房间(N<=10000)和M条通道(M<=100000),每个通道都是单向的,就是说若