if there is a reverse edge from u to i , then only update
if ( g [ u ] [ i ] . second ) { disRev [ v ] . second = disRev [ u ] . second + 1 ; totalRev ++ ; } totalRev += dfs ( g , disRev , visit , v ) ; } }