Advertisement
999ms

Untitled

Mar 1st, 2019
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. vector<int> g[n];
  2. bool used[n] = {false};
  3. void dfs(int from){
  4. used[from] = true;
  5. for(int i : g[from]){
  6. if(!used[i]) {
  7. dfs(i);
  8. }
  9. }
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement