this repo has no description
1int: n; 2array [1..n] of var 1..n: q; % i列的皇后在行q[i] 3 4include "alldifferent.mzn"; 5 6constraint alldifferent(q); % 不同行 7constraint alldifferent([ q[i] + i | i in 1..n]); % 不同对角线 8constraint alldifferent([ q[i] - i | i in 1..n]); % 上+下 9 10% 搜索 11solve :: int_search(q, first_fail, indomain_min, complete) 12 satisfy; 13output [ if fix(q[j]) == i then "Q" else "." endif ++ 14 if j == n then "\n" else "" endif | i,j in 1..n]