题目:http://acm.hdu.edu.cn/showproblem.php?pid=1085母函数问题,分步求解一个一个进行#include using namespa
原创
2022-08-22 17:47:57
40阅读
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>#include<string.h&
转载
2012-03-06 01:15:00
37阅读
2评论
Holding Bin-Laden Captive!Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s):
原创
2022-03-18 15:32:27
50阅读
题意: 给A个1元,B个2元,C个5元,问最小的不能拼出的钱是多少 考虑生成函数$G(x)=(1+x+x2+...+xA)(1+x2+x4+...+x^{2B})(1+x5+x10+...+x^{5C})$ 最小的系数为0的项,其指数就是答案 #include<bits/stdc++.h> usin ...
转载
2021-08-04 11:01:00
63阅读
2评论
Holding Bin-Laden Captive!HDU - 1085We all know that Bin-Lade
原创
2023-06-09 14:02:35
47阅读
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
原创
2021-07-29 16:19:16
318阅读
题解: 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的数#include<stdio.h>int main(){ int a,b,c; while(scanf("%d %d %d",&a,&b,&c)!=EOF&&(a!=0||b!=0||c!=0)) { if(a==0) { printf("1\n"); } else if(2*...
转载
2013-05-30 12:43:00
31阅读
Holding Bin-Laden Captive! Time Limit: 2000/1000 MS (Java/Others)
转载
2015-09-20 16:08:00
47阅读
2评论
题目地址:点击打开链接思路:挺不错的一题,写完这一题感觉彻底把母函数吃透了,总共写了五种代码,运行时间一次比一次少,最次
原创
2022-08-04 09:00:56
43阅读
poj 1085 题目大意: 有一个币值系统,里面有 1元,2元,5元,其数量分别为 num1 张,n\
原创
2022-11-17 00:17:16
25阅读
Holding Bin-Laden Captive!
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
原创
2023-04-20 11:32:29
51阅读
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
转载
2016-05-02 22:06:00
32阅读
2评论
http://acm.hdu.edu.cn/showproblem.php?pid=1085Problem DescriptionWe all know that Bin-Laden is a notorious...
转载
2019-05-23 09:52:00
125阅读
2评论
题目Problem DescriptionWe 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 terr...
原创
2021-07-13 13:57:17
135阅读
http://acm.hdu.edu.cn/showproblem.php?pid=1085Problem DescriptionWe all know that Bin-Laden is a notorious...
转载
2019-05-23 09:52:00
93阅读
2评论
Holding Bin-Laden Captive!Time Limit: 2000/1000 MS (Java/Others)Memory L notorious terrorist, and he has disappeared for a long time. But recently, it is reported
原创
2022-03-18 15:38:09
61阅读
题意:有三种硬币面值分别为1 2 5, 给定每种硬币的数量,问用这些硬币不能组成的最小面值是多少思路:因为每个硬币有个数限制,但是也不难构造出G(x)=(1+x+x^2+...+x^num1)(1+x^2+x^4+...+x^2*num2)(1+x^5+x^10+...+x^5*num5)将多项式展开后,xi项对应的系数就是组成面值为i的方案数。#include <...
原创
2022-08-17 15:35:24
28阅读
//给你面值为1,2,5的三种硬币固定的数目,求不能凑出的最小钱数 //G(x)=(1+x+...+x^num1)(1+x^2+...+x^2num2)(1+x^5+,,,+x^5num3), //展开,系数不为0的数都是能够由硬币组合出来的。 # include <algorithm> # inc
转载
2016-02-03 11:34:00
23阅读
2评论
题干:We all know that Bin-Laden is a notorious terrorist, and he has disappeared for a long time.
原创
2022-06-15 10:15:14
24阅读
Holding Bin-Laden Captive!Time Limit: 2000/1000 MS (Ja
原创
2022-12-02 00:17:09
88阅读