Description The N (2 <= N <= 10,000) cows are so excited: it's prom night! They are dressed in their finest gowns, complete with corsages and new shoes. They know that tonight they will each try to perform the Round Dance. Only cows can perform the…
这… 本来想学习一下Tarjan算法的,没想到码都码好了发现这题不是求强连通分量而是简单的连通分量…图论基础都还给老师了啊啊啊!最后深搜通通解决! v标记是否被访问过,scc标记每个的祖先(本来想写Tarjan的才弄出这么奇葩个数组名字),w用于最后的统计. program vijos_p1023; ..,..] of longint; v,w:..] of boolean; n,m,t,i,ans,top:longint; low,s,scc:..] of longint; procedure…