Last active
September 7, 2017 14:53
-
-
Save lsiddiqsunny/b393d75da09792f1e514b1d03e0bda9f 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
for(int i=1;i<=n;i++) | |
{ | |
memset(visited,0,sizeof visited); | |
dfs(i); | |
for(int j=1;j<=n;j++) | |
if(visited[j]==1) | |
ans[i]=ans[i]+cost[j]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment