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++ AfxBeginThread和AfxEndThread 使用方法
启动线程: CWinThread* AfxBeginThread( 线程函数,this ); 线程的退出: 在刚刚使用的时候,退出线程的方法有问题,导致退出的时候异常. 下面说线程退出的方法: 1. ...
- 通过DOS命令批量重命名文件
以下为提供的两种方法:遍历当前目录下的所有文件名以.avi结尾的文件,然后权限规则进行修改(规则含义请自行查找资料).第一种方法有缺陷,更改完所有的文件名后,会多改一次.请斟酌使用.第二种方法解决了第 ...
- 推荐几个Adobe Flex Builder 3的插件(代码格式化和fms服务器通讯文件(main.asc)编写)
1.Fms plugins 编写FMS服务器端脚本时,最头疼的莫过于AS1的语法了.习惯了AS2.3后,在没有代码提示的环境下,写代码确实是件很头疼的事,这个插件就可以发挥作用了. Flash Med ...
- 吴裕雄 03-mysql连接
mysqli_connect(host,username,password,dbname,port,socket);参数 描述host 可选.规定主机名或 IP 地址.username 可选.规定 M ...
- java中Integer和int的区别(转)
int和Integer的区别 1.Integer是int的包装类,int则是java的一种基本数据类型 2.Integer变量必须实例化后才能使用,而int变量不需要 3.Integer实际是对象的引 ...
- css3选择器补充
一.关系选择器 1.E+F (E元素下一个满足条件的兄弟元素节点) <style> div + p{ background-color:red;// 第一个p元素变色 } </s ...
- zabbix 利用python脚本实现短信告警
一.编写脚本 cd /usr/local/zabbix-4.0.3/share/zabbix/alertscripts vi zabbix_sms.py 内容如下: #!/usr/bin/python ...
- kali安装显卡驱动
由于我们使用cpu一般最多也就是4到16核,而一块不错的gpu可以多大上千核,在并行复杂运算能力上GPU的运算速度远远超过CPU的运算速度,所以很多场合比如暴力穷举破解,挖矿更多地使用GPU,所以有必 ...
- JMeter调试工具--Debug Sampler(转载)
转载自 http://www.cnblogs.com/fengpingfan Debug Sampler添加路径:[添加 / Sampler / Debug Sampler],面板设置如下: 打开JM ...
- IDEA2017-破解方法
@方法一 第一步:下载jar 包 地址:https://github.com/locationbai/registerIDEA_2017.3.2_jar 第二部:将下载好的jar放在idea安装目录下 ...