Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void dfs(int v){
- if (color[v] != 0) {
- return;
- }
- color[v]=1
- for (int i=0;i<n;i++){
- if (a[v][i]&&color[v]==0){
- dist[i] = dist[v]+1; dfs(i);
- }
- }
- color[v]=z;
- }
- int main(){
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement