EX_03/level-2/n_queens/subject.txt
2025-09-23 08:41:21 +01:00

28 lines
722 B
Plaintext

Assignement name : n_queens
Expected files : *.c *.h
Allowed functions : atoi, fprintf, write, calloc, malloc, free, realloc, stdout, stderr
-------------------------------------------------------------------------
Write a program that will print all the solutions to the n queens problem
for a n given as argument.
We will not test with negative values.
The order of the solutions is not important.
You will display the solutions under the following format :
<p1> <p2> <p3> ... \n
where pn are the line index of the queen in each colum starting from 0.
For example this should work :
$> ./n_queens 2 | cat -e
$> ./n_queens 4 | cat -e
1 3 0 2$
2 0 3 1$
$> ./n_queens 7 | cat -e
0 2 4 6 1 3 5$
0 3 6 2 5 1 4$
etc...