Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //sudo code
- // vertex are colored with black & white colors
- //http://codeforces.com/contest/557/submission/11870749
- for(int i=0;i<n;i++)
- {
- if(!vis[i])
- dfs(i,0);
- for(auto u:v[i])
- if(color[u]==color[i]){
- return "found odd cycle";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement