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\% 的数据,保证 n106n\leq 10^6

初一竞赛组——动态规划初步

Not Claimed
Status
Done
Problem
8
Open Since
2024-11-12 15:15
Deadline
2024-12-7 23:59
Extension
24 hour(s)