Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- using namespace std;
- vector<bool> used;
- vector<int> color;
- vector<vector<int>> g;
- bool odd_acyclic = true;
- void dfs(int u, int col) {
- used[u] = true;
- color[u] = col;
- for (auto v : g[u]){
- if (!used[v])
- dfs(v, (col + 1) % 2);
- if (used[v] && color[v] == col){
- odd_acyclic = false;
- }
- }
- }
- int main() {
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement