Hit the Lottery

简介: Hit the Lottery

文章目录

一、Hit the Lottery

总结


一、Hit the Lottery

本题链接:Hit the Lottery


题目:

A. Hit the Lottery

time limit per test1 second

memory limit per test256 megabytes

inputstandard input

outputstandard output

Allen has a LOT of money. He has n dollars in the bank. For security reasons, he wants to withdraw it in cash (we will not disclose the reasons here). The denominations for dollar bills are 1, 5, 10, 20, 100. What is the minimum number of bills Allen could receive after withdrawing his entire balance?


Input

The first and only line of input contains a single integer n (1≤n≤109).


Output

Output the minimum number of bills that Allen could receive.


Examples

input

125

output

3

input

43

output

5

input

1000000000

output

10000000


Note

In the first sample case, Allen can withdraw this with a 100 dollar bill, a 20 dollar bill, and a 5 dollar bill. There is no way for Allen to receive 125 dollars in one or two bills.


In the second sample case, Allen can withdraw two 20 dollar bills and three 1 dollar bills.


In the third sample case, Allen can withdraw 100000000 (ten million!) 100 dollar bills.


本博客给出本题截图:

image.png

题意: 纸币有大有小,问最少可以用多少张纸币表示数字n

AC代码

#include <cstdio>
using namespace std;
int main()
{
    int a[5] = {1, 5, 10, 20, 100};
    int n;
    scanf("%d", &n);
    int res = 0;
    for (int i = 4; i >= 0; i -- )
    {
        int t = n / a[i];
        res += t;
        n -= a[i] * t;
    }
    printf("%d\n", res);
    return 0;
}

总结

水题,不解释


目录
相关文章
|
前端开发 JavaScript Java
网易音乐网站系统|前后端分离springboot+vue实现在线音乐网站
网易音乐网站系统|前后端分离springboot+vue实现在线音乐网站
1790 0
|
存储 机器学习/深度学习 大数据
量子计算与大数据:处理海量信息的新方法
量子计算作为革命性的计算范式,凭借量子比特和量子门的独特优势,展现出在大数据处理中的巨大潜力。本文探讨了量子计算的基本原理、在大数据处理中的应用及面临的挑战与前景,展望了其在金融、医疗和物流等领域的广泛应用。
|
存储 SQL 分布式计算
一文快速了解ClickHouse 战斗民族的开源搜索引擎(超详细解读+快速入门)
大家好,我是**ChinaManor**,直译过来就是中国码农的意思,俺希望自己能成为国家复兴道路的铺路人,大数据领域的耕耘者,一个平凡而不平庸的人。
一文快速了解ClickHouse 战斗民族的开源搜索引擎(超详细解读+快速入门)
|
弹性计算 JSON 运维
基础设施代码化(IaC)的自动化配置与编排
本文将基于基础设施即代码 IaC 理念,分享如何借助自动化编排工具实现自动化部署,使得云上运维工作更为高效。
基础设施代码化(IaC)的自动化配置与编排
|
存储 弹性计算 人工智能
洞见科技携手阿里云,以“隐私计算+云”推动场景应用大规模落地
基于阿里云第七代实例构建的隐私计算解决方案,提供稳定可靠、灵活调度的算力来源,更好地帮助洞见科技为政务、金融等客户打破数据孤岛,赋能数据价值的安全释放和数据智能的合规应用。
洞见科技携手阿里云,以“隐私计算+云”推动场景应用大规模落地
|
4天前
|
云安全 人工智能 算法
以“AI对抗AI”,阿里云验证码进入2.0时代
三层立体防护,用大模型打赢人机攻防战
1315 4
|
4天前
|
机器学习/深度学习 安全 API
MAI-UI 开源:通用 GUI 智能体基座登顶 SOTA!
MAI-UI是通义实验室推出的全尺寸GUI智能体基座模型,原生集成用户交互、MCP工具调用与端云协同能力。支持跨App操作、模糊语义理解与主动提问澄清,通过大规模在线强化学习实现复杂任务自动化,在出行、办公等高频场景中表现卓越,已登顶ScreenSpot-Pro、MobileWorld等多项SOTA评测。
660 3
|
5天前
|
人工智能 Rust 运维
这个神器让你白嫖ClaudeOpus 4.5,Gemini 3!还能接Claude Code等任意平台
加我进AI讨论学习群,公众号右下角“联系方式”文末有老金的 开源知识库地址·全免费
|
11天前
|
编解码 人工智能 自然语言处理
⚽阿里云百炼通义万相 2.6 视频生成玩法手册
通义万相Wan 2.6是全球首个支持角色扮演的AI视频生成模型,可基于参考视频形象与音色生成多角色合拍、多镜头叙事的15秒长视频,实现声画同步、智能分镜,适用于影视创作、营销展示等场景。
766 6