HDU 2844 Coins(多重背包)http://acm.hdu.edu.cn/showproblem.php?pid=2844题意: 如今有价值val[1],val[2],…val[n]的n种硬币, 它们的数量分别为num[i]个. 然后给你一个m, 问你区间[1,m]内的全部数目, 由之前n...
分类:
其他好文 时间:
2014-10-31 09:57:39
阅读次数:
267
Square Coins
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 8487 Accepted Submission(s): 5774
Problem Description
People in Silverl...
分类:
其他好文 时间:
2014-10-30 17:10:42
阅读次数:
159
POJ 3260 The Fewest Coins(多重背包+完全背包)
http://poj.org/problem?id=3260
题意:
John要去买价值为m的商品. 现在的货币系统有n种货币,对应面值为val[1],val[2]…val[n]. 然后他身上每种货币有num[i]个. John必须付给售货员>=m的金钱, 然后售货员会用最少的货币数量找钱给John.
问你John的交易过程中, 他给售货员的货币数目+售货员找钱给他的货币数目 的和最小值是多少?
分析:
本题...
分类:
其他好文 时间:
2014-10-30 11:43:18
阅读次数:
164
题目大意:给你几种硬币的价值和数量,再给你一个最大钱数M,问你这些硬币能
组成价值1到M的值有多少种
思路:简单的多重背包,如果总容量比这个物品的容量要小,那么这个物品可以直
接取完,相当于完全背包。否则的话就转成01背包来求解。...
分类:
其他好文 时间:
2014-10-29 17:00:26
阅读次数:
275
HDU Coins(多重背包)
http://acm.hdu.edu.cn/showproblem.php?pid=2844
题意:
现在有价值val[1],val[2],…val[n]的n种硬币, 它们的数量分别为num[i]个. 然后给你一个m, 问你区间[1,m]内的所有数目, 由之前n种硬币来构造(即选取某些硬币使得这些硬币的价值和等于[1,m]区间的特定数), 最多能构造出这m个数中的多少个?
分析:
基本的完全背包问题.
我们令dp[i][j]==x表示...
分类:
其他好文 时间:
2014-10-28 20:04:39
阅读次数:
205
UVA 10306 e-Coins(完全背包)
题意:
对于每个样例,先给定两个数n,m,分别表示有n种硬币,对于每一种硬币有两个价值,分别记做x,y,题目要求从中选择一些硬币,使得满足m*m=X*X+Y*Y, 其中X是选出的硬币的所有x价值的和,Y是所有选出的硬币的y价值的和,硬币有无数多个,现在要求的是,满足上述要求使用的最少的硬币数....
分类:
其他好文 时间:
2014-10-24 22:24:21
阅读次数:
264
New Zealand currency consists of $100, $50, $20, $10, and $5 notes and $2, $1, 50c, 20c, 10c and 5c coins. Write a program that will determine, for any given amount, in how many ways that amount may b...
分类:
其他好文 时间:
2014-10-23 22:49:46
阅读次数:
247
Problem DescriptionWhuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were some ...
分类:
其他好文 时间:
2014-10-22 09:57:35
阅读次数:
269
# This python file uses the following encoding: utf-8# In England the currency is made up of pound, £, and pence, p, and there are eight coins in gene...
分类:
编程语言 时间:
2014-10-19 11:29:47
阅读次数:
207
Suppose there are 5 types of coins: 50-cent, 25-cent, 10-cent, 5-cent, and 1-cent. We want to make changes with these coins for a given amount of money.
For example, if we have 11 cents, then we...
分类:
其他好文 时间:
2014-10-12 03:01:27
阅读次数:
238