Satisfiability Problem · SAT solvers
Lesson 1
Programming problem. Implement a program that reads an integer \(4 \le n \le 80\) and places \(n\) mutually non-attacking queens on an \(n \times n\) board. Output a permutation \(\pi_{0}, \dotsc, \pi_{n-1}\) of \(\{0, 1, \dotsc, n-1\}\): \(\pi_{i}\) is the index of the column having a queen in the \(i\)-th row.
Public samples
Input
4
Expected output
2 0 3 1