2025 AIME II 第 8 题
先试着解答 2025 AIME II 第 8 题,然后核对你的答案与精心整理的解答,解答来自 LIVE by Po-Shen Loh。你也可以参加完整限时模拟考试、查看全部 2025 AIME II 解答,或核对答案。
所有题目均经美国数学协会(MAA)官方合法授权使用。
8.
Silas 有无限多枚 分硬币、 分硬币和 分硬币。他想找出若干硬币,使总价值为 分,其中 是正整数。他使用所谓的 贪心算法:每一步都选择不会使当前总价值超过 的最大面值硬币。例如,为了凑 分,Silas 会选择一枚 分硬币、一枚 分硬币,然后选择 枚 分硬币。然而,这组 枚硬币比必要数量更多;事实上, 选择 枚 分硬币和 枚 分硬币也能得到同样总价值 分,且只用 枚硬币。
一般来说,若不存在另一组 分、 分和 分硬币,能用严格更少的硬币数凑出 分,则称贪心算法对该 成功。求 到 (含端点)之间使贪心算法成功的 的个数。
From an unlimited supply of -cent coins, -cent coins, and -cent coins, Silas wants to find a collection of coins that has a total value of cents, where is a positive integer. He uses the so-called greedy algorithm, successively choosing the coin of greatest value that does not cause the value of his collection to exceed For example, to get cents, Silas will choose a -cent coin, then a -cent coin, then -cent coins. However, this collection of coins uses more coins than necessary to get a total of cents; indeed, choosing -cent coins and -cent coins achieves the same total value with only coins.
In general, the greedy algorithm succeeds for a given if no other collection of -cent, -cent, and -cent coins gives a total value of cents using strictly fewer coins than the collection given by the greedy algorithm. Find the number of values of between and inclusive for which the greedy algorithm succeeds.
答案:610
解答:
在任意最优组合中,最多有 枚一分硬币(十枚一分可换成一枚十分),最多有 枚十分硬币 (五枚十分可换成两枚二十五分),所以十分和一分硬币的总价值最多为 分。因此一个最优组合使用 枚二十五分硬币,和贪心算法一样,或使用 枚二十五分硬币。 对于只由十分和一分硬币组成的金额 ,最佳硬币数为 ,这正是贪心算法处理余数的方式。
令 。贪心算法使用 枚硬币,唯一的竞争方案使用 枚硬币(当 时可行),所以贪心算法失败当且仅当 。列表计算:对 , ;对 , ;对 , ;对 , ;对 , 。所以贪心算法失败恰好发生在 且 时。
在 中,每个模 的余数类都有 个 ,所以上述 个余数给出 个值,其中小于 的 个值不计入失败(此时 )。 因而贪心算法失败于 个值,成功于 个值。
In any optimal collection there are at most pennies (ten pennies could become a dime) and at most dimes (five dimes could become two quarters), so its dimes and pennies are worth at most cents. Hence an optimal collection uses either quarters, like greedy, or quarters. For an amount made only of dimes and pennies, the best count is which is what greedy does on the remainder.
Let Greedy uses coins, and the only rival uses coins (possible when ), so greedy fails exactly when Tabulating: for for for for for So greedy fails exactly when and
Each residue class mod contains values of in so these residues give values, of which the values less than do not count (there ). Greedy fails for values and succeeds for
其他年份的第 8 题
1997 AIME · 1998 AIME · 1999 AIME · 2000 AIME I · 2000 AIME II · 2001 AIME I · 2001 AIME II · 2002 AIME I · 2002 AIME II · 2003 AIME I · 2003 AIME II · 2004 AIME I · 2004 AIME II · 2005 AIME I · 2005 AIME II · 2006 AIME I · 2006 AIME II · 2007 AIME I · 2007 AIME II · 2008 AIME I · 2008 AIME II · 2009 AIME I · 2009 AIME II · 2010 AIME I · 2010 AIME II · 2011 AIME I · 2011 AIME II · 2012 AIME I · 2012 AIME II · 2013 AIME I · 2013 AIME II · 2014 AIME I · 2014 AIME II · 2015 AIME I · 2015 AIME II · 2016 AIME I · 2016 AIME II · 2017 AIME I · 2017 AIME II · 2018 AIME I · 2018 AIME II · 2019 AIME I · 2019 AIME II · 2020 AIME I · 2020 AIME II · 2021 AIME I · 2021 AIME II · 2022 AIME I · 2022 AIME II · 2023 AIME I · 2023 AIME II · 2024 AIME I · 2024 AIME II · 2025 AIME I · 2026 AIME I · 2026 AIME II