HDU_1085_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): 19908 Accepted Submission(s): 8865
“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!
0 0 0
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std; int c1[];
int c2[];
int c3[]; int main()
{
int a,b,c;
while(scanf("%d%d%d",&a,&b,&c)!=EOF&&(a||b||c))
{
memset(c1,,sizeof(c1));
memset(c2,,sizeof(c2));
memset(c3,,sizeof(c3));
for(int i=; i<=a; i++)
c1[i]=;
for(int i=; i<=a; i++)
for(int j=; j<=*b; j+=)
c2[i+j]+=c1[i]; for(int i=;i<=a+b*;i++)
{
c1[i]=c2[i];
c2[i]=;
}
for(int i=; i<=(a*)+(b*); i++)
for(int j=; j<=*c; j+=)
c2[i+j]+=c1[i];
for(int i=;i<=a+b*+c*;i++)
c1[i]=c2[i];
/*for(int i=0;i<=a+2*b+5*c;i++)
cout<<c1[i]<<endl;
cout<<endl;*/
for(int i=;i<=a+*b+*c+;i++)
if(c1[i]==)
{
printf("%d\n",i);
break;
}
}
return ;
}
HDU_1085_Holding Bin-Laden Captive!_母函数的更多相关文章
- 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 ...
- HDOJ 1085 Holding Bin-Laden Captive! (母函数)
Holding Bin-Laden Captive! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Ja ...
- HDOJ/HDU 1085 Holding Bin-Laden Captive!(非母函数求解)
Problem Description We all know that Bin-Laden is a notorious terrorist, and he has disappeared for ...
- hdu 2079 选课时间_母函数
题意:需要学够n学分,有k个情况(x学分,y个相同学分的课) 解法:套母函数模板 #include <iostream> #include<cstdio> using name ...
- hdu1085 Holding Bin-Laden Captive!(母函数)
简单的母函数应用. #include<iostream> #include<cstdio> #include<cstdlib> #include<cstrin ...
- Bash 中的 _ 是不是环境变量
首先,我们想到的会是 export(等价于 declare -x)命令: $ export | grep 'declare -x _=' 没有找到,那么结论就是 _ 不是环境变量?当然没那么简单,否则 ...
- python_login输入三次错误密码锁定密码_密码不允许为空
#!/usr/bin/env python #_*_coding:utf-8_*_ #by anthor zhangxiaoyu 2017-01-10 import getpass import os ...
- Python-老男孩-01_基础_文件IO_函数_yield_三元_常用内置函数_反射_random_md5_序列化_正则表达式_time
Python2.7 缩进统一: 约定 常量 大写 , 变量 小写 判断一个变量在内存中的地址,也能看出是不是一个值 id()函数 >>> x = 'abc' >>&g ...
随机推荐
- SiteMesh2-decorators.xml文件
SiteMesh默认使用decorators.xml作为装饰配置文件. decorators.xml顶层元素概览如下: <decorators> <decorator/> &l ...
- Cisco IOU Web Interface : Web IOU
https://github.com/dainok http://sns.clnchina.com.cn/space.php?uid=404779&do=blog&id=4298 ht ...
- ArcGIS 10.1 for Server安装教程系列—— Linux下的单机安装
http://www.oschina.net/question/565065_81231 因为Linux具有稳定,功能强大等特性,因此常常被用来做为企业内部的服务器,我们的很多用户也是将Ar ...
- 并发数 = QPS*平均响应时间
转:https://blog.csdn.net/luman1991/article/details/70919279 并发数 = QPS*平均响应时间 QPS(TPS):每秒钟request 每秒查询 ...
- HTTPS那些事 用java实现HTTPS工作原理
HTTPS那些事 用java实现HTTPS工作原理 博客分类: java历险 今天被问到关于https原理的问题,结果由于知识掌握不牢靠,停留于表面,很多细节都无法回答清楚,于是决定把https的 ...
- com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$Mis
为什么会出现这个错误? 我使用了Maven配置Struts,所以改动Struts配置文件的默认路径,例如以下: <!-- 配置struts --> <filter> <f ...
- oop_day06_抽象类、接口_20150814
oop_day06_抽象类.接口_20150814 1.static final常量: 1)必须声明同一时候初始化.不能改动,类名点来訪问 2)常量名建议全部字母都大写 3)编译器编译时会直接替换为详 ...
- java-javabean Introspector的应用
Introspector 类为通过工具学习有关受目标 Java Bean 支持的属性.事件和方法的知识提供了一个标准方法. 对于这三种信息,Introspector 将分别分析 bean 的类和超类, ...
- windows 下 opencv 3.x 的安装及常见问题的解决
1. 下载与配置 下载地址:Releases - OpenCV library(选择合适的平台和版本) 配置步骤见:VS 2013 统一修改所有工程的目录配置(以 boost.opencv3 的安装为 ...
- poj3469 Dual Core CPU——最小割
题目:http://poj.org/problem?id=3469 最小割水题(竟然没能1A): 代码如下: #include<iostream> #include<cstdio&g ...