N Queens by murky-satyr

!function r(y,a,z,b,x){for(x=y--?-1:print(a);++x<n;z&c|b&d||r(y,a+1?a+' '+x:x,z|c,b|d))c=(1|1<<y+9)<<x,d=1<<9+x-y}(n=readline())

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page