华东交通大学2015年ACM“双基”程序设计竞赛1004
Problem D
Time Limit : 3000/1000ms (Java/Other) Memory Limit : 65535/32768K (Java/Other)
Total Submission(s) : 945 Accepted Submission(s) : 121
Font: Times New Roman | Verdana | Georgia
Font Size: ← →
Problem Description
面额的钞票,分别是20,10,5,4,1。但是不变的是他的小气(同题2),现在
又有很多人来取钱,黄又不开心了,请你算出每个来取钱的人黄应该给他
多少张钞票。
Input
Output
Sample Input
1
Sample Output
1
Author
#include<stdio.h>
//#include<bits/stdc++.h>
#include<string.h>
#include<iostream>
#include<math.h>
#include<sstream>
#include<set>
#include<queue>
#include<map>
#include<vector>
#include<algorithm>
#include<limits.h>
#define inf 0x3fffffff
#define INF 0x3f3f3f3f
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define LL long long
#define ULL unsigned long long
using namespace std;
int main()
{
int n;
int a;
int sum;
while(scanf("%d",&n)!=EOF)
{
sum=0;
/* int b=1+5;
int c=4+4;
int d=5+4;
int e=10+4;
int h=10+1;//取2的
int b1=3+4;
int c1=10+2;
int d1=10+5+1;
int e1=19;
int r1=18;
int t1=13;//取3的
int sum=0;*/
a=n%20;
sum+=n/20;
if(a<=3)
{
sum+=a;
}
else if(a==1||a==4||a==5||a==10)
{
sum+=1;
}
else if(a==6||a==6||a==8||a==9||a==11||a==14||a==15)
{
sum+=2;
}
else if(a==7||a==12||a==13||a==16||a==18||a==19)
{
sum+=3;
}
else if(a==3||a==17)
{
sum+=4;
}
printf("%d\n", sum); }
return 0;
}
华东交通大学2015年ACM“双基”程序设计竞赛1004的更多相关文章
- 华东交通大学2015年ACM“双基”程序设计竞赛1002
Problem B Time Limit : 3000/1000ms (Java/Other) Memory Limit : 65535/32768K (Java/Other) Total Sub ...
- 华东交通大学2015年ACM“双基”程序设计竞赛1007
Problem G Time Limit : 3000/1000ms (Java/Other) Memory Limit : 65535/32768K (Java/Other) Total Sub ...
- 华东交通大学2015年ACM“双基”程序设计竞赛1003
Problem C Time Limit : 3000/1000ms (Java/Other) Memory Limit : 65535/32768K (Java/Other) Total Sub ...
- 华东交通大学2015年ACM“双基”程序设计竞赛1005
Problem E Time Limit : 3000/2000ms (Java/Other) Memory Limit : 65535/32768K (Java/Other) Total Sub ...
- 华东交通大学2015年ACM“双基”程序设计竞赛1001
Problem A Time Limit : 3000/1000ms (Java/Other) Memory Limit : 65535/32768K (Java/Other) Total Sub ...
- 华东交通大学2016年ACM“双基”程序设计竞赛 1004
Problem Description LB是个十分喜欢钻研的人,对什么事都要搞明白.有一天他看到一个公式,((a-b)*c+d*e)/f=k.他想如果给定K的值,一共有多少种不同整数的组合(a,b, ...
- 华东交通大学2018年ACM“双基”程序设计竞赛 C. 公式题 (2) (矩阵快速幂)
题目链接:公式题 (2) 比赛链接:华东交通大学2018年ACM"双基"程序设计竞赛 题目描述 令f(n)=2f(n-1)+3f(n-2)+n,f(1)=1,f(2)=2 令g(n ...
- 华东交通大学2018年ACM“双基”程序设计竞赛部分题解
链接:https://ac.nowcoder.com/acm/contest/221/C来源:牛客网 C-公式题(2) 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 32768K,其 ...
- 华东交通大学2016年ACM“双基”程序设计竞赛 1007
Problem Description ACM小学妹在今天的暑假训练结束后,想看球赛放松一下.当他打开电脑时查询到联盟今天直播N场球赛,每场球赛的起止时间(S1,E1),(S2,E2),...,(SN ...
随机推荐
- hadoop-eclipse-plugin-2.6.0-cdh5.4.0 插件编译
1.JDK配置 1) 安装jdk 2) 配置环境变量 JAVA_HOME.CLASSPATH.PATH等设置 2.Eclipse 1).下载eclipse-jee-juno-SR2.rar 2).解压 ...
- 3-3 zookeeper的作用体现
zookeeper比较重要的一个模式:选举模式,这也是高可用的一个体现.公司的董事长.副董事长.董事会常理员以及老总和副总,他们并不会乘坐同一班飞机,而是会分为两班或者三班飞机一起去,也就是我们所谓的 ...
- CodeForces 478D Red-Green Towers (DP)
题意:给定 n 块红砖,m 块绿砖,问有多少种方式可以建造成最高的塔,每一层颜色必须一样. 析:首先要确定最高是多少层h,大约应该是用 h * (h+1) <= (m+n) * 2,然后dp[i ...
- Oracle 函数-字符型函数
1.字符型函数 函数 说明 案例 结果 ASCII(X) 求字符X的ASCII码 select ASCII('A') FROM DUAL; 65 CHR(X) 求ASCII码对应的字符 select ...
- sql语句增加字段 索引
alter table order_info add area varchar(50) create index group_compar on ry_order (group_compar); ...
- [转]Marshaling a SAFEARRAY of Managed Structures by P/Invoke Part 3.
1. Introduction. 1.1 In part 1 of this series of articles, I demonstrated how to transfer managed ar ...
- MongoDB 分片1
第一步: 准备数据节点 必须添加–shardsvr参数. mongod--port32770--shardsvr--dbpathD:\db\mongodata\shard\mongodb1--logp ...
- 根据GridView模板里的列名获取列索引
以前Insus.NET在写过一篇<在Gridview控件中根据Field Name来取得对应列索引> http://www.cnblogs.com/insus/archive/2010/0 ...
- 解决RegexKitLite导入报错问题
1.RegexKitLite是什么? RegexKitLite是一个非常方便的处理正则表达式的第三方类库. 本身只有一个RegexKitLite.h和RegexKitLite.m 2.导入RegexK ...
- AI-Info-Micron-Insight:工业 5.0,伟大的思想将殊途同归
ylbtech-AI-Info-Micron-Insight:工业 5.0,伟大的思想将殊途同归 1.返回顶部 1. 工业 5.0,伟大的思想将殊途同归 两个头脑比一个好吗?似乎如此,尤其是当其中一个 ...