回溯
def backtrack(path, state, opts): if base: # 基线条件 res.append(path) return for opt in opts: if prune: # 剪枝条件 re