Back to task

184 symbols python3
Thu Oct 20 04:04:43 2016 Sait2000
N=range(int(input()))
z=[[]]
for r in N:z=[s+[(r,c)]for s in z for c in N if~-any(r==i or c==j or c-j in(r-i,i-r)for i,j in s)]
print("\n".join("".join(str(q[1])for q in s)for s in z))


Leave a comment

Parsed as Markdown

Login to leave a comment