Created
January 3, 2021 19:40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int dfs(int u) | |
{ | |
int &res = dp[u]; | |
if(res) return res; | |
res = 1; | |
for(auto ch : st[u].Next) { | |
int v = ch.second; | |
res += dfs(v); | |
} | |
return res; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment