Created
October 5, 2021 06:01
-
-
Save HarshKumarChoudary/9b5313fd5079e6c2038bf3dfeee9a505 to your computer and use it in GitHub Desktop.
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
ll cnt =0; | |
ll dfs(ll i,ll pre,vector<ll>&a,vector<vector<ll>>&edges,ll val){ | |
ll cur = a[i]; | |
for(auto x:edges[i]){ | |
if(x==pre) | |
continue; | |
cur^=dfs(x,i,a,edges,val); | |
} | |
if(cur==val) | |
++cnt,cur = 0; | |
return cur; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment