Back to task

171 symbols python3
Thu Oct 20 04:23:59 2016 Sait2000
N,*z=range(int(input())),[]
for r in N:z=[s+[(r,c)]for s in z for c in N if~-any(0in(r-i,c-j)or c-j in(r-i,i-r)for i,j in s)]
for s in z:print(''.join(str(j)for i,j in s))


Leave a comment

Parsed as Markdown

Login to leave a comment