Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vector<int> g[n];
- bool used[n] = {false};
- void dfs(int from){
- used[from] = true;
- for(int i : g[from]){
- if(!used[i]) {
- dfs(i);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement