fix several bugs

This commit is contained in:
krahets
2023-10-17 23:45:31 +08:00
parent 51405c0669
commit 5392afd44b
14 changed files with 15 additions and 15 deletions

View File

@ -16,7 +16,7 @@ void backtrack(vector<int> &state, const vector<int> &choices, vector<bool> &sel
// 遍历所有选择
for (int i = 0; i < choices.size(); i++) {
int choice = choices[i];
// 剪枝:不允许重复选择元素 且 不允许重复选择相等元素
// 剪枝:不允许重复选择元素
if (!selected[i]) {
// 尝试:做出选择,更新状态
selected[i] = true;