3A - Holding Bin-Laden Captive!
“Oh, God! How terrible! ”
Don’t be so afraid, guys. Although he hides in a cave of Hang Zhou, he dares not to go out. Laden is so bored recent years that he fling himself into some math problems, and he said that if anyone can solve his problem, he will give himself up!
Ha-ha! Obviously, Laden is too proud of his intelligence! But, what is his problem?
“Given some Chinese Coins (硬币) (three kinds-- 1, 2, 5), and their number is num_1, num_2 and num_5 respectively, please output the minimum value that you cannot pay with given coins.”
You, super ACMer, should solve the problem easily, and don’t forget to take $25000000 from Bush!
Input
Input contains multiple test cases. Each test case contains 3 positive integers num_1, num_2 and num_5 (0<=num_i<=1000). A test case containing 0 0 0 terminates the input and this test case is not to be processed.
Output
Output the minimum positive value that one cannot pay with given coins, one line for one case.
Sample Input
1 1 3
0 0 0
Sample Output
4 // 看代码好好理解一下。。太小不行,太大也不行
#include<stdio.h>
int main()
{
int a, b, c, n;
while(scanf("%d %d %d", &a, &b, &c), a||b||c)
{
if(a==) printf("1\n");
else if(a+*b<) printf("%d\n", a+*b+);
else printf("%d\n", a+*b+*c+);
}
return ;
}
3A - Holding Bin-Laden Captive!的更多相关文章
- 缓冲区溢出利用——捕获eip的傻瓜式指南
[译文] 摘要:为一个简单的有漏洞程序写一个简单的缓冲区溢出EXP,聚焦于遇到的问题和关键性的教训,提供详细而彻底的描述 内容表:1. I pity the fool, who can't smash ...
- 用主题模型可视化分析911新闻(Python版)
本文由 伯乐在线 - 东狗 翻译,toolate 校稿.未经许可,禁止转载!英文出处:blog.dominodatalab.com.欢迎加入翻译小组. 本文介绍一个将911袭击及后续影响相关新闻文章的 ...
- How do I learn mathematics for machine learning?
https://www.quora.com/How-do-I-learn-mathematics-for-machine-learning How do I learn mathematics f ...
- Labeled Faces in the Wild 人脸识别数据集 部分测试数据
development test set Note: images displayed are original (non-aligned/funneled) images. match pairs ...
- HDOJ 1085 Holding Bin-Laden Captive! (母函数)
Holding Bin-Laden Captive! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Ja ...
- HDU 1085 Holding Bin-Laden Captive! (母函数)
Holding Bin-Laden Captive! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Ja ...
- Holding Bin-Laden Captive!(母函数)
Holding Bin-Laden Captive! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Ja ...
- Holding Bin-Laden Captive!(杭电1085)(母函数)
Holding Bin-Laden Captive! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Ja ...
- Holding Bin-Laden Captive!(1.多重背包 2.母函数)
Holding Bin-Laden Captive! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/ ...
随机推荐
- C++ 使用VS2010创建MFC ActiveX工程项目
1.ActiveX的基本概念 ActiveX控件可以看作是一个极小的服务器应用程序,它不能独立运行,必须嵌入到某个容器程序中,与该容器一起运行.这个容器包括WEB网页,应用程序窗体等... Activ ...
- unity3d assetbundle打包策略
由于assetbundle打包存在依赖的问题,所有资源要进行合理的分包 零.代码 代码都放在本地,包括NGUI等插件的代码.shader代码(内置的shader无需打包,而自定义的shader还是需要 ...
- 吴裕雄 12-MySQL WHERE 子句
以下是 SQL SELECT 语句使用 WHERE 子句从数据表中读取数据的通用语法:SELECT field1, field2,...fieldN FROM table_name1, table_n ...
- 对于目标识别的一些idea-传递特征的position而不是特征或特征图
我们在目标识别中通常是识别到目标的,通过proposals回归的方式,但是如果我们可以在 训练过程中识别到特征以后,将特征的位置信息传到下一层网络这样是否会训练收敛更快, 精度更高. 可能这也是以后机 ...
- ADO.Net创建数据模型和数据访问类及泛型集合
数据模型和数据访问类:数据模型: 使用面向对象中的封装特性,将数据表中的行数据组成一个同样结构的对象,来单独使用: 数据访问类: 将某一个表的全部增删改查操作的方法写进去,方便统一管理和调用: 数据模 ...
- Using Service Workers
[Using Service Workers] 1.This is an experimental technology Because this technology's specification ...
- ORACLE 把不是SYS用户下的所有JOB删除掉
BEGIN FOR job_id in(select job,log_user,priv_user,schema_user from dba_jobs) LOOP IF(job_id.lo ...
- centos搭建OPENldap
LDAP是轻量目录访问协议,英文全称是Lightweight Directory Access Protocol,一般都简称为LDAP.它是基于X.500标准的,但是简单多了并且可以根据需要定制.与X ...
- SoundChannel和soundTransform的关系
SoundChannel 音乐的 播放 暂停 当前获取当前位置 长度 leftPeak : Number[只读] 左声道的当前幅度(音量),范围从 0(静音)至 1(最大幅度) rightPe ...
- 全国绿色计算大赛 模拟赛第一阶段(C++)第1关:求和
挑战任务 这次“绿盟杯”大赛,小明作为参赛选手在练习的时候遇到一个问题,他要对一个范围的两个数进行数位的累加,例如有两个数 15,19 则 他们的数位和应该为:1+5+1+6+1+7+1+8+1+9, ...