HDUOJ--Holding Bin-Laden Captive!
Holding Bin-Laden Captive!
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 12069 Accepted Submission(s): 5394
“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!
#include<iostream>
#define maxn 9000
using namespace std;
int c1[maxn],c2[maxn];
int main()
{
int num1,num2,num3,i,j;
while(cin>>num1>>num2>>num3,num1+num2+num3)
{
memset(c1,,sizeof(c1));
memset(c2,,sizeof(c2));
for(i=;i<=num1;i++)
{
c1[i]=;
for(j=;j<=num2;j++)
{
c2[*j+i]+=c1[i];
}
}
for(i=;i<=num1+*num2;i++)
{
c1[i]=c2[i];
c2[i]=;
}
for(i=;i<=num1+*num2;i++)
{
for(j=;j<=num3;j++)
{
c2[i+*j]+=c1[i];
}
}
for(i=;i<=num1+*num2+*num3;i++)
{
if(c2[i]==)
{
break;
}
}
cout<<i<<endl;
}
return ;
}
HDUOJ--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/ ...
- hdu 1085 给出数量限制的母函数问题 Holding Bin-Laden Captive!
Holding Bin-Laden Captive! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Ja ...
随机推荐
- 发布设置setting.xml
<?xml version="1.0" encoding="UTF-8"?> <!-- User-specific configuration ...
- Go 语言简介(下)— 特性
希望你看到这篇文章的时候还是在公交车和地铁上正在上下班的时间,我希望我的这篇文章可以让你利用这段时间了解一门语言.当然,希望你不会因为看我的文章而错过站.呵呵. 如果你还不了解Go语言的语法,还请你移 ...
- [转贴] 数字证书及 CA 的扫盲介绍
[略有删节] 为了达到普及的效果,俺会尽量用比较浅显,非技术的语言来讲清楚. ★先说一个通俗的例子 考虑到证书体系的相关知识比较枯燥.晦涩.俺先拿一个通俗的例子来说事儿. ◇普通的介绍信 想必大伙 ...
- Median of Two Sorted Array leetcode java
题目: There are two sorted arrays A and B of size m and n respectively. Find the median of the two sor ...
- 动态装载外部JavaScript脚本文件
当我们请求一个URL地址时,浏览器会从远程服务器装载各种所需的资源,如JavaScript.CSS.图片等.而在加载JavaScript时,常常会发生下面这种情况: 也就是说,当浏览器碰到Script ...
- C#(64位系统) 解决"未能加载文件或程序集,或它的某一个依赖项..."
这个问题通常出在引用第三方DLL或者自己以前写的DLL. 在64位系统下则可能会出现这种问题. 今天下载MySQLDriverCS后引用遍出现了这个问题,参考了一些文档,下面给出解决方法: 将项目的生 ...
- 【翻译自mos文章】CRS显示 正在执行的db instance 是offline状态
CRS显示 正在执行的db instance 是offline状态 转自: CRS shows Running Instance Status as OFFLINE (Doc ID 1673397.1 ...
- Android -- MeasureSpec
自定义控件都会去重写View的onMeasure方法,因为该方法指定该控件在屏幕上的大小. protected void onMeasure (int widthMeasureSpec, int he ...
- java 判断字符串是否相等 (转)
http://blog.csdn.net/chtnj/article/details/7909720 判断字符串相等我们经常习惯性的写上if(str1==str2),这种写法在java中可能会带来问题 ...
- [Backbone] Verying Views
Below we have our AppointmentsView instance rendering and then taking the rendered HTML and insertin ...