当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

1085:Holding Bin-Laden Captive!

题目描述
We all know that Bin-Laden is a notorious terrorist, and he has disappeared for a long time. But recently, it is reported that he hides in Hang Zhou of China!
“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 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 the minimum positive value that one cannot pay with given coins, one line for one case.
输入样例
1 1 3
0 0 0
输出样例
4
来自杭电HDUOJ的附加信息
Author lcy
Recommend

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-1085

最后修改于 2020-10-25T22:42:02+00:00 由爬虫自动更新

共提交 159

通过率 5.66%
时间上限 内存上限
2000/1000MS(Java/Others) 65536/32768K(Java/Others)