N Queens by nn

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

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

download

return to the top page