Advertisement
Guest User

Untitled

a guest
Sep 15th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. #include<stdbool.h>
  2. bool validSolution(
  3. unsigned int w[9][9
  4. ]){unsigned int r[9
  5. ]={0},c[9]={0},b[9]
  6. ={0};for(int i=0;i<
  7. 9;++i)for(int j=0;j
  8. <9;++j){int _= 3*(i
  9. /3)+(j/3),v=1<<w[i]
  10. [j];if(v&1||(r[i]|c
  11. [j]|b[_])&v) return
  12. 0;else r[i]|=v,c[j]
  13. |=v,b[_]|=v;}return
  14. /******/true;;;;;;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement