this repo has no description
at develop 519 B view raw
1int: n; 2% La reina de la i columna está en la fila q[i] 3array [1..n] of var 1..n: q; 4 5include "alldifferent.mzn"; 6 7% Distintas filas. 8constraint alldifferent(q); 9 10% Distintas diagonales. 11constraint alldifferent([ q[i] + i | i in 1..n]); 12 13% Hacia arriba + hacia abajo. 14constraint alldifferent([ q[i] - i | i in 1..n]); 15 16% Búsqueda. 17solve :: int_search(q, first_fail, indomain_min, complete) 18 satisfy; 19output [ if fix(q[j]) == i then "Q" else "." endif ++ 20 if j == n then "\n" else "" endif | i,j in 1..n]