this repo has no description
at develop 358 B view raw
1include "alldifferent.mzn"; 2 3int: n; 4 5array[1..n] of var 1..n: x; % 数字的序列 6array[1..n-1] of var 1..n-1: u; % 差的序列 7 8constraint alldifferent(x); 9constraint alldifferent(u); 10constraint forall(i in 1..n-1)(u[i] = abs(x[i+1] - x[i])); 11 12solve :: int_search(x, first_fail, indomain_min, complete) 13 satisfy; 14output ["x = ",show(x),"\n"];