Holding Bin-Laden Captive!
Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 6600Accepted Submission(s): 2894
Problem Description
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
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
Sample Output
4
这个题我们仍然模拟多项式乘法。最后计算就是了。
我的代码:
分享到:
相关推荐
杭电acm解题报告 详细解析2000-2099 适合acm初学者
ACM ICPC HDOJ1003
ACM ICPC HDOJ1000
hdoj上的资源,代码有注释,很不错的哦
收集的部分HDOJ杭电ACM题的代码 大牛勿下 全是基础供初级acmer使用
hdoj解题代码,题目为1000-1050
自己积累的部分杭电oj的(hdu)解题代码。。大家有空来看看。 基本上是自己写的哈。有错误之处请指教、
HDOJ题目分类HDOJ题目分类HDOJ题目分类
leetcode和hdoj 简介 主要用来记录算法刷题记录和一些模板 文件结构 leetcode 存放leetcode题目和周赛 atcoder 用于存放参与和vp的atcoder比赛 codeforces 用于存放参与和vp的cf比赛,比赛文件夹以比赛序号和div描述...
我去年暑假花了5天,把杭电ACM网站上2000到2099这100道题全AC了,又花了10来天精心写解题报告。 里面包括题目、解题思路、编程技巧以及参考源码。所有代码都是使用C/C++写的。 最近整理资料时无意间发现,打包...
codj,hdoj的源码(50-60题)
HDOJ从零到零 <<< <<< <<< >>> >>> >>> :calendar:阶段性计划 :bullseye: 2021-04-30〜30题
ACM ICPC HDOJ1004
ACM ICPC HDOJ1002
杭州电子科技大学hdoj1002,大整数相加问题
ACM ICPC HDOJ1001
hdoj1001标程
some code of HDOJ of mine
包括简单数学 组合数学 动态规划 贪心算法 母函数 搜索算法 组合博弈论 计算几何 等等
杭电oj4405,一道简单的概率dp题目