砝码

Python 称砝码

def count_possible_weights(n, weights, counts):# 初始化 dp 集合,包含 0(不称任何砝码)dp = {0}# 遍历每种砝码for i in range(n):weight = weights[i]count

python dp 砝码 2025-02-24 17:27  2