Нет, это не проверка, а намёк на то, что решение получено вручную. АИ небитое d5 не пропустил бы!
Нарисовано вручную человеком. С выдачи MiniZinc по коду, написанному ChatGPT. Например. Да, 15 решений.
(Код бесплатного ChatGPT)
Код:
include "globals.mzn";
array[1..4] of var 1..6: x;
array[1..4] of var 1..6: y;
array[1..4] of bool: q = [true, true, false, false];
% No two pieces attack each other
constraint forall(i,j in 1..4 where i < j) (
x[i] != x[j] /\ y[i] != y[j] /\
(q[i] \/ q[j] ->
abs(x[i]-x[j]) != abs(y[i]-y[j]))
);
% Every empty square is attacked
constraint forall(c,r in 1..6) (
exists(i in 1..4)(x[i]=c /\ y[i]=r) \/
exists(i in 1..4)(
x[i]=c \/ y[i]=r \/
(q[i] /\ abs(x[i]-c)=abs(y[i]-r))
)
);
% Square content: 0=empty, 1=queen, 2=rook
function var int: cell(var int: c, var int: r) =
sum(i in 1..4)(
if x[i]=c /\ y[i]=r then
if q[i] then 1 else 2 endif
else 0 endif
);
% Board in row-major order
array[1..36] of var int: board =
[cell(c,r) | r in 1..6, c in 1..6];
% Lexicographic comparison
predicate my_lex_leq(
array[1..36] of var int: a,
array[1..36] of var int: b
) =
exists(k in 1..36)(
forall(j in 1..k-1)(a[j]=b[j]) /\
a[k] < b[k]
) \/ forall(j in 1..36)(a[j]=b[j]);
% Exclude all seven non-identity symmetries
constraint forall(t in 1..7)(
my_lex_leq(board, [
cell(
if t=1 then 7-c
elseif t=2 then 7-c
elseif t=3 then c
elseif t=4 then r
elseif t=5 then 7-r
elseif t=6 then r
else 7-r endif,
if t=1 then r
elseif t=2 then 7-r
elseif t=3 then 7-r
elseif t=4 then 7-c
elseif t=5 then c
elseif t=6 then c
else 7-c endif
)
| r in 1..6, c in 1..6
])
);
% Remove permutations of identical pieces
constraint x[1] < x[2] \/
(x[1]=x[2] /\ y[1]<y[2]);
constraint x[3] < x[4] \/
(x[3]=x[4] /\ y[3]<y[4]);
solve satisfy;
output [
concat([
if q[i] then "Q" else "R" endif ++
show(x[i]) ++ show(y[i]) ++ " "
| i in 1..4
])
];