Type: RemoteJudge 1000ms 128MiB

硬币问题

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

题目描述

今有面值为 1、5、11 元的硬币各无限枚。

想要凑出 nn 元,问需要的最少硬币数量。

输入格式

仅一行,一个正整数 nn。

输出格式

仅一行,一个正整数,表示需要的硬币个数。

15
3
12
2

提示

样例解释

对于样例数据 1,最佳方案是 15=5+5+515=5+5+5,使用到 3 枚硬币。

对于样例数据 2,最佳方案是 12=11+112=11 + 1,使用到 2 枚硬币。

数据规模与约定

对于 100%100\% 的数据,保证 n≤106n\leq 10^6。

入门3 递推 DP 背包

Not Attended
Status
Done
Rule
IOI
Problem
6
Start at
2026-9-21 1:00
End at
2026-9-28 1:00
Duration
168 hour(s)
Host
Partic.
33