第42361题 判断题
下面的贪心代码,对于任意硬币面值集合 coins,都一定可以求出凑出 money 所需要的最少硬币数量。
count = 0
# coins 按面值从大到小排序
for coin in coins:
    count += money // coin
    money = money % coin
{{ option.label }}
子题{{ index + 1 }} {{ child.type_label }}
{{ option.label }}
✓ 正确 ◐ 部分正确 ✗ 错误
程序运行统计
暂无判题统计
知识点:
提交{{ questionInfo.stats ? questionInfo.stats.submit_count : 0 }}次 正确率{{ statsAccuracy }}%
答案解析