E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
Bin-Laden
HDU 1085 Holding
Bin-Laden
Captive! 活捉本拉登(普通型母函数)
题意:有面值分别为1、2、5的硬币,分别有num_1、num_2、num_5个,问不能组成的最小面值是多少?(00)思路:母函数解决。只有3个括号要作乘法,分别代表面值1、2、5所能组成的情况。需要两个数组,所能组成的最大值为num_1+2*num_2+5*num_5。如果在这个范围内都能组成,那么最小不能组成的面值为num_1+2*num_2+5*num_5+1。若没有1分钱的硬币,那么不能组成
badiu_30394251
·
2020-08-24 03:19
HDOJ-1085-Holding
Bin-Laden
Captive! 解题报告
普通母函数水题。题意:有三种面值的硬币,一元,两元和五元,个数分别为num_1,num_2,num_5,现在求不能一次性付清的最少钱数。比如如果你只有一个两元硬币,那么1元就是你无法一次付清的最少钱数。我的解题思路:以钱数来做x的指数,那么这道题其实就是求指数最小的系数为0项(指数为0不算)了。我的解题代码:#include#include#include#include#include#incl
剑紫青天
·
2020-08-02 17:53
ACM题解
【组合数学】
HDOJ
题解
ACM解题报告
Holding
Bin-Laden
Captive!
刷水题,找自信。。。HoldingBin-LadenCaptive!TimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):16075AcceptedSubmission(s):7212ProblemDescriptionWeallknowthatBin-Ladenisano
威萌
·
2020-07-10 04:17
贪心动规
水题
HDOJ/HDU 1085 Holding
Bin-Laden
Captive!(非母函数求解)
ProblemDescriptionWeallknowthatBin-Ladenisanotoriousterrorist,andhehasdisappearedforalongtime.Butrecently,itisreportedthathehidesinHangZhouofChina!“Oh,God!Howterrible!”Don’tbesoafraid,guys.Althoughheh
qq_26525215
·
2016-06-26 17:00
java
ACM
Hdu 1085 Holding
Bin-Laden
Captive!
ProblemDescriptionWeallknowthatBin-Ladenisanotoriousterrorist,andhehasdisappearedforalongtime.Butrecently,itisreportedthathehidesinHangZhouofChina!“Oh,God!Howterrible!”Don’tbesoafraid,guys.Althoughheh
zyq_19960204
·
2016-05-03 16:00
hdu1085Holding
Bin-Laden
Captive!(母函数)
HoldingBin-LadenCaptive!TimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):19565 AcceptedSubmission(s):8698ProblemDescriptionWeallknowthatBin-Ladenisanoto
zs520ct
·
2016-04-18 10:00
母函数
HDU 1085 Holding
Bin-Laden
Captive!(母函数)
题目:HDU-1085题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1085题目:HoldingBin-LadenCaptive!TimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):19057 Accepted
qq_33171970
·
2016-02-14 18:00
HDU
1085
hdu1085——Holding
Bin-Laden
Captive!
HoldingBin-LadenCaptive!TimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):19031 AcceptedSubmission(s):8466ProblemDescriptionWeallknowthatBin-Ladenisanoto
qq_33110317
·
2016-02-06 17:00
生活
博客
HDU
hdoj 1085 Holding
Bin-Laden
Captive!【母函数】
HoldingBin-LadenCaptive!TimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):18960 AcceptedSubmission(s):8447ProblemDescriptionWeallknowthatBin-Ladenisanoto
liu6886
·
2016-01-28 18:00
HDOJ 1085 Holding
Bin-Laden
Captive!(母函数)
HoldingBin-LadenCaptive!TimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):18962 AcceptedSubmission(s):8448ProblemDescriptionWeallknowthatBin-Ladenisano
zwj1452267376
·
2016-01-28 16:00
HDOJ 1085 Holding
Bin-Laden
Captive!(母函数)(未解决)
ProblemDescriptionWeallknowthatBin-Ladenisanotoriousterrorist,andhehasdisappearedforalongtime.Butrecently,itisreportedthathehidesinHangZhouofChina! “Oh,God!Howterrible!”Don’tbesoafraid,guys.Althoughhe
u013555159
·
2016-01-27 23:00
HDU 1085.Holding
Bin-Laden
Captive!【用1、2、5凑数】【水】【12月30】
HoldingBin-LadenCaptive!ProblemDescriptionWeallknowthatBin-Ladenisanotoriousterrorist,andhehasdisappearedforalongtime.Butrecently,itisreportedthathehidesinHangZhouofChina! “Oh,God!Howterrible!”Don’tbe
a995549572
·
2015-12-30 00:00
C++
数学
ACM
凑数
杭电 1085 Holding
Bin-Laden
Captive!
#include<stdio.h> #include<string.h> #include<stdlib.h> int main() { int num1,num2,num3; int c1[10000],c2[10000];//万恶的数组,害我又一次纠结了,本来,我开1000的,结果一直wa,后来我在看了一下题目,发现竟然是说num-i
·
2015-11-12 19:01
apt
HDUOJ--Holding
Bin-Laden
Captive!
Holding
Bin-Laden
Captive!
·
2015-11-12 12:18
HDU
杭电1085(多重背包求解)
题目: We all know that
Bin-Laden
is a notorious terrorist, and he has disappeared for a long time.
·
2015-11-12 10:43
杭电
HDU 1085 Holding
Bin-Laden
Captive --生成函数第一题
生成函数题。 题意:有币值1,2,5的硬币若干,问你最小的不能组成的币值为多少。 解法:写出生成函数: 然后求每项的系数即可。 因为三种硬币最多1000枚,1*1000+2*1000+5*1000=8000,那么多项式乘积的最高次数为8000 用c保存累计相乘各项的系数,tc保存c和当前项相乘的系数 代码: #include <iostream> #inclu
·
2015-11-12 10:50
HDU
HDUOJ-----1085Holding
Bin-Laden
Captive!
Holding
Bin-Laden
Captive!
·
2015-11-11 19:12
HDU
HDU 1085
Holding
Bin-Laden
Captive!
·
2015-11-11 17:51
HDU
hdu 1085 Holding
Bin-Laden
Captive!
题目意思是给定数量的1,2,5面值的硬币,问不能够成的最小面值。这题应该有多种解法,动态规划,母函数应该都行。不过最简单的方法还是发现了其中的规律以后,其实一般情况下结果应该都是a + 2 * b + 5 * c + 1,特殊情况加以判断即可,情况也不多,几行代码搞定。 #include <stdio.h>int main() { int a, b, c, x;/* f
·
2015-11-11 10:13
HDU
母函数 HDU 1085 Holding
Bin-Laden
Captive!
这几天看了某大神写的关于母函数的文章,总算基本搞明白,就找这类题练练,这题是母函数变种 一开始WA了好几次,搞不懂原因, 后来发现原来我忽略了,不能最小的不能组合数 可以大于所有1,2,5的总和 #include <iostream> using namespace std; in
·
2015-11-07 13:55
HDU
杭电 1085 Holding
Bin-Laden
Captive!
Problem Description We all know that
Bin-Laden
is a notorious terrorist, and he has disappeared
·
2015-11-07 10:24
apt
HDU 1085 Holding
Bin-Laden
Captive!
We all know that
Bin-Laden
is a notorious terrorist, and he has disappeared for a long time.
·
2015-11-03 22:50
HDU
hdu 1085 Holding
Bin-Laden
Captive!
Problem Description We all know that
Bin-Laden
is a notorious terrorist, and he has disappeared for
·
2015-11-02 15:11
HDU
HDU 1085 Holding
Bin-Laden
Captive! 活捉本拉登(AC代码)普通型母函数
题意:有面值分别为1、2、5的硬币,分别有num_1、num_2、num_5个,问不能组成的最小面值是多少?(0<=每种硬币个数<=1000,组成的面值>0) 思路:母函数解决。只有3个括号要作乘法,分别代表面值1、2、5所能组成的情况。需要两个数组,所能组成的最大值为num_1+2*num_2+5*num_5。如果在这个范围内都能组成,那么最小不能组成的面值为
·
2015-11-01 10:38
HDU
HDU 1085 Holding
Bin-Laden
Captive! (母函数 | 多重背包)
Holding
Bin-Laden
Captive!
·
2015-11-01 08:01
HDU
HDU 1085 Holding
Bin-Laden
Captive!
HDU_1085 这个题目可以用完全背包问题的思路去解,为了练一下生成函数,我就用生成函数的思路写了一下,构造生成函数G(x)=(1+x+x^2+…+x^n1)(1+x^2+x^4+…+x^(2*n2))(1+x^5+x^25+…+x^(5*n3)),最后按x,x^2…的顺序看哪一项的系数为0即可。 #include<stdio.h>#inc
·
2015-10-31 14:40
HDU
HDU 1085 Holding
Bin-Laden
Captive!
Holding
Bin-Laden
Captive!
·
2015-10-31 12:14
HDU
Holding
Bin-Laden
Captive!_hdu_1085(DP).java
/* * 9607741 2013-11-17 18:04:23 Accepted 1085 187MS 5700K 1251 B Java zhangyi http://acm.hdu.edu.cn/showproblem.php?pid=1085 Time Limit: 2000/1000 MS (Java/Others)
·
2015-10-30 14:50
java
HDU-1085 Holding
Bin-Laden
Captive-母函数
Holding
Bin-Laden
Captive!
·
2015-10-30 11:13
HDU
组合数学 - 母函数的运用 --- 模板题
Holding
Bin-Laden
Captive!
·
2015-10-28 08:25
函数
Holding
Bin-Laden
Captive!(hdoj1085)代码并未完全看懂
We all know that
Bin-Laden
is a notorious terrorist, and he has disappeared for a long time.
·
2015-10-28 08:10
apt
HD1085 Holding
Bin-Laden
Captive!
Problem Description We all know that
Bin-Laden
is a notorious terrorist, and he has disappeared for
·
2015-10-28 08:20
apt
hdu 1085 给出数量限制的母函数问题 Holding
Bin-Laden
Captive!
Holding
Bin-Laden
Captive!
·
2015-10-27 11:03
HDU
hdu 1085 Holding
Bin-Laden
Captive!
题解: 1.若num_1=0,显然答案为1; 2.若num_1!=0;能产生直到2*num_2+num_1; 的数 3.若2*num_2+num_1>=4,则能产生直到5*num_3+2*num_2+num_i的数 #in
·
2015-10-21 11:14
HDU
HDU_1085 Holding
Bin-Laden
Captive!(生成函数)
/*按照母函数的思路,然后模拟三个括号相乘的过程。因为题目已经限定好了硬币只能是1、2、5。所以可以写成:(1 + X + X^2 + ...)(1 + X^2 + X^4 + X^6 + ...)(1 + X^5 + X^10 + X^15 + ...)其中三个括号元素的个数分别是输入的num_1, num_2, num_3。然后就是模拟多项式相乘了。*///ps:代码有点水,一步一步乘的,
·
2015-10-21 11:31
HDU
HDU 1085 Holding
Bin-Laden
Captive!(数论)
Description给a个1,b个2,c个5,问它们不能组成的最小正整数是谁Input多组用例,每组用例占一行包括三个整数a,b,c,以000结束输入Output对于每组用例,输出给出的数不能组成的最小正整数SampleInput113000SampleOutput4Solution任意一个大于等于5的正整数显然可以被表示成5x+y的形式,任何一个小于5的正整数显然也可以被表示成2x+y的形式,
V5ZSQ
·
2015-09-05 23:00
hdu 1085 Holding
Bin-Laden
Captive!
母函数水题。#include #include #include #include #include #include #include #include usingnamespacestd; #definelllonglong intc[8010]; intmain(){ intnum_1,num_2,num_5; while(cin>>num_1>>num_2>>num_5){
squee_spoon
·
2015-08-16 22:00
hdoj 1085 Holding
Bin-Laden
Captive!【基础母函数】
HoldingBin-LadenCaptive!TimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):17382 AcceptedSubmission(s):7797ProblemDescriptionWeallknowthatBin-Ladenisanoto
chenzhenyu123456
·
2015-08-03 21:00
HDOJ Holding
Bin-Laden
Captive! 1085【母函数】
HoldingBin-LadenCaptive!TimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):17379 AcceptedSubmission(s):7795ProblemDescriptionWeallknowthatBin-Ladenisanoto
ydd97
·
2015-08-03 20:00
【HDOJ 1085】数学问题,母函数
Holding
Bin-Laden
Captive!
·
2015-07-26 14:00
函数
HDU 1085 Holding
Bin-Laden
Captive!
题目地址:点击打开链接思路:挺不错的一题,总共写了六种代码,运行时间一次比一次少,最次的代码思路正确,只不过写废了就不贴了,最次的代码的思想的把单个硬币能表示出来的敲出来,接着再组合,而且每次循环到8001,很容易超时,母函数为(1+x^1+x^2+..x^n)(1+x^2+x^4+..+x^2n)(1+x^5+x^10+..+x^5n)其中n为每个种类硬币的数量,剩下的5种代码简介如下AC代码1
qq_25605637
·
2015-07-17 15:00
hdu 1085 Holding
Bin-Laden
Captive!(母函数)
代码:#include #include usingnamespacestd; longlongc1[8005],c2[8005]; intmain() { inta[4]; a[1]=1; a[2]=2; a[3]=5; intn[4]; while(scanf("%d%d%d",&n[1],&n[2],&n[3])&&(n[1]||n[2]||n[3])) { memset(c1,0,si
xky1306102chenhong
·
2015-06-06 15:00
母函数
hdu1085(Holding
Bin-Laden
Captive!)
hdu1085思路:这个与前面的稍微有点区别,就是它的重复的个数是给定的,所以在做多项式相乘是注意控制别超了个数就行了。importjava.util.*; classMain{ publicstaticvoidmain(Stringargs[]){ finalintMAX=8010; int[]price={1,2,5}; Scannersc=newScanner(System.in); whi
u011479875
·
2015-04-08 17:00
hdu 1085 Holding
Bin-Laden
Captive!(母函数)
题目大意:给出1、2、5分硬币数目,问不能构成的面值的最小值是多少。生成函数:(1+x+x^2+x^3……x^k1)*(1+x^2+x^4……x^2*k2)*(1+x^5+x^10……x^5*k3)#include #include #include #include #include usingnamespacestd; intc[8005],c0[8005],v[4]={0,1,2,5},a[
u014679804
·
2015-04-05 16:00
hdu 1085 Holding
Bin-Laden
Captive! 母函数的基本运用,,还是不难的
HoldingBin-LadenCaptive!TimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):16063 AcceptedSubmission(s):7206ProblemDescriptionWeallknowthatBin-Ladenisanoto
Lionel_D
·
2015-03-02 20:00
ca
holding
母函数
hdu1085
Bin-Laden
HDU1085 Holding
Bin-Laden
Captive!(母函数)
HoldingBin-LadenCaptive!题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1085解题思路:一道母函数的题目,至于有关母函数详细的讲解,请看这个人的博客:http://www.wutianqi.com/?p=596至于我对母函数的理解吧,个人认为其实还是很简单的,代码里有备注。AC代码:#include #include #inc
piaocoder
·
2014-12-04 09:00
母函数
HDU 1085 Holding
Bin-Laden
Captive! 【母函数】
HoldingBin-LadenCaptive!TimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):15590 AcceptedSubmission(s):6977ProblemDescriptionWeallknowthatBin-Ladenisanoto
u013806814
·
2014-11-29 22:00
HDU
组合数
Holding
Bin-Laden
Captive!(母函数)
HoldingBin-LadenCaptive!TimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):15010 AcceptedSubmission(s):6726ProblemDescriptionWeallknowthatBin-Ladenisanotori
猪刚烈
·
2014-09-24 13:00
hdu 1085 Holding
Bin-Laden
Captive!(母函数)
http://acm.hdu.edu.cn/showproblem.php?pid=1085题意:1元,2元,5元的硬币分别有num[1],num[2],num[3]个。问用这些硬币不能组合成的最小钱数。继续母函数。有两个注意的地方:对c2[]初始化的同时也要对c1[]初始化。最后枚举到sum+1,因为存在[1,sum]都可以凑成的可能,这时输出sum+1。#include #include #i
u013081425
·
2014-07-27 19:00
母函数
HDU1085 Holding
Bin-Laden
Captive! 【母函数】
HoldingBin-LadenCaptive!TimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):14543 AcceptedSubmission(s):6514ProblemDescriptionWeallknowthatBin-Ladenisanoto
u012846486
·
2014-07-25 23:00
hdu1085
上一页
1
2
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他