题目链接:POJ-3260 题意是一个人买东西,有n种纸币,面额为v[i],数量为c[i]。同时售货员也有这些纸币,数量为无限。要买价值为t的东西,希望给“钱用的纸币数和着钱用的纸币数的和”最少。 思路很显然是完全背包和多重背包各处理售货员和这位老哥。这个题给出所有v[i]<=120,这一点很有迷惑 ...
分类:
其他好文 时间:
2017-02-11 18:03:24
阅读次数:
205
题解: 也是比较简单的DP dp[i][j]表示第i个。以字母j结尾的最小值 注意小trick. 整个分组都同一个字母,这时候就不用判断头尾是否相同了 代码用到了一些c ++ 11的新姿势,auto太强了~ 代码: ...
分类:
其他好文 时间:
2016-12-04 07:55:14
阅读次数:
127
You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you nee ...
分类:
其他好文 时间:
2016-10-26 07:15:58
阅读次数:
205
The Fewest Coins Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 6299 Accepted: 1922 Description Farmer John has gone to town to buy some f ...
分类:
其他好文 时间:
2016-09-23 21:16:55
阅读次数:
194
You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you nee ...
分类:
其他好文 时间:
2016-08-05 06:37:27
阅读次数:
180
You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you nee ...
分类:
编程语言 时间:
2016-07-01 16:16:27
阅读次数:
148
You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you nee ...
分类:
其他好文 时间:
2016-06-06 09:07:06
阅读次数:
161
题目链接:https://leetcode.com/problems/coin-change/
题目:
You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that y...
分类:
其他好文 时间:
2016-05-30 15:00:29
阅读次数:
107
You are given coins of different denominations and a total amount of money amount. Write a function to compute the fewest number of coins that you nee
分类:
其他好文 时间:
2016-01-29 21:13:20
阅读次数:
147
You are given coins of different denominations and a total amount of moneyamount. Write a function to compute the fewest number of coins that you need...
分类:
其他好文 时间:
2016-01-18 06:53:23
阅读次数:
200