小编AAA*_*AAA的帖子

这个prolog优化解决方案有什么问题?

solve(Amounts) :-
    Total = 1505,
    Prices = [215, 275, 335, 355, 420, 580],

    length(Prices, N),
    length(Amounts, N),
    Amounts :: 0..Total//min(Prices),
    Amounts * Prices #= Total,

    labeling(Amounts).
Run Code Online (Sandbox Code Playgroud)

prolog clpfd eclipse-clp

3
推荐指数
1
解决办法
127
查看次数

标签 统计

clpfd ×1

eclipse-clp ×1

prolog ×1