Advertisement
Guest User

Untitled

a guest
Sep 21st, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4.  
  5. using namespace std;
  6.  
  7. vector<bool> used;
  8. vector<int> color;
  9. vector<vector<int>> g;
  10. bool odd_acyclic = true;
  11.  
  12.  
  13.  
  14. void dfs(int u, int col) {
  15. used[u] = true;
  16. color[u] = col;
  17. for (auto v : g[u]){
  18. if (!used[v])
  19. dfs(v, (col + 1) % 2);
  20. if (used[v] && color[v] == col){
  21. odd_acyclic = false;
  22. }
  23. }
  24. }
  25.  
  26. int main() {
  27.  
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement