码迷,mamicode.com
首页 >  
搜索关键字:coins    ( 511个结果
POJ 1742 Coins ( 经典多重部分和问题 && DP || 多重背包 )
题意 : 有 n 种面额的硬币,给出各种面额硬币的数量和和面额数,求最多能搭配出几种不超过 m 的金额? 分析 : 这题可用多重背包来解,但这里不讨论这种做法。 如果之前有接触过背包DP的可以自然想到DP数组的定义 ==> dp[i][j] 表示使用前 i 种硬币是否可以凑成面额 j 。 根据这样的 ...
分类:其他好文   时间:2017-12-17 22:23:42    阅读次数:138
POJ3682King Arthur's Birthday Celebration(数学期望||概率DP)
King Arthur is an narcissist who intends to spare no coins to celebrate his coming K-th birthday. The luxurious celebration will start on his birthday ...
分类:其他好文   时间:2017-12-17 15:03:02    阅读次数:189
HDU3579Hello Kiki(中国剩余定理)(不互质的情况)
One day I was shopping in the supermarket. There was a cashier counting coins seriously when a little kid running and singing "门前大桥下游过一群鸭,快来快来 数一数,二四六 ...
分类:其他好文   时间:2017-12-17 11:06:01    阅读次数:229
POJ2096Collecting Bugs(数学期望,概率DP)
问题: Ivan is fond of collecting. Unlike other people who collect post stamps, coins or other material stuff, he collects software bugs. When Ivan gets ...
分类:其他好文   时间:2017-12-08 13:51:53    阅读次数:212
动态规划初步
凑钱问题: 题目:给一个总额amount,以及现有的钱币面值数组coins,要求计算最少需要多少张coins中的钱币才能凑出总额; 动态规划是将大问题转化为小问题,然后一步步求解出最终结果。具体到这道题,我们可以把大问题即凑amount元转化为凑齐amout-1,amount-2等等 当我们计算"凑 ...
分类:其他好文   时间:2017-11-14 16:24:39    阅读次数:133
[USACO06DEC]最少的硬币The Fewest Coins
题目描述 约翰在镇上买了 T 元钱的东西,正在研究如何付钱。假设有 N 种钞票,第 i 种钞票的面值为 Vi,约翰身上带着这样的钞票 Ci 张。商店老板罗伯是个土豪,所有种类的钞票都有无限张。他们有洁癖,所以希望在交易的时候,交换的钞票张数尽可能地少。请告诉约翰如何恰好付掉 T 元,而且在过程中交换 ...
分类:其他好文   时间:2017-11-06 17:14:07    阅读次数:162
[USACO 13NOV]No Change
Description Farmer John is at the market to purchase supplies for his farm. He has in his pocket K coins (1 <= K <= 16), each with value in the range ...
分类:其他好文   时间:2017-10-29 15:15:05    阅读次数:177
CF 875B Sorting the Coins
题目链接:http://codeforces.com/problemset/problem/875/B 题意:一开始给定n个不流通的硬币,每次增加让其中一个硬币流通,流通的硬币的下一个如果不流通,那么就交换两个硬币。 直到两个流通的硬币在一起,或者两个不流通的硬币在一起,那就不用交换了。初始观察次数 ...
分类:其他好文   时间:2017-10-25 19:56:05    阅读次数:186
leetcode练习:441. Arranging Coins
You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly k coins. Given n, find the total number ...
分类:其他好文   时间:2017-10-24 20:52:17    阅读次数:169
【题解】coin HDU2884 多重背包
题目 Coins Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 12330 Accepted Submission(s): 4922 Probl ...
分类:其他好文   时间:2017-10-22 21:33:17    阅读次数:201
511条   上一页 1 ... 15 16 17 18 19 ... 52 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!