Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdbool.h>
- bool validSolution(
- unsigned int w[9][9
- ]){unsigned int r[9
- ]={0},c[9]={0},b[9]
- ={0};for(int i=0;i<
- 9;++i)for(int j=0;j
- <9;++j){int _= 3*(i
- /3)+(j/3),v=1<<w[i]
- [j];if(v&1||(r[i]|c
- [j]|b[_])&v) return
- 0;else r[i]|=v,c[j]
- |=v,b[_]|=v;}return
- /******/true;;;;;;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement