l******d 发帖数: 530 | 1 如果面额组合满足下面条件,是不是就可以用greedy algorithm找最优解?
for each denomination, the denomination just smaller than it was a perfect
divisor of it. (i.e. 25 was a factor of 125; 5 was a factor of 25; 1 was a
factor of 5}.
http://tkramesh.wordpress.com/2011/03/09/greedy-algorithms-coin
面试时要是碰到这个组合,直接跟面试官说it is proven that... so I will use
greedy algorithm instead of DP here,行不 |
w****x 发帖数: 2483 | 2
满足这些面额的确可以用greedy
【在 l******d 的大作中提到】 : 如果面额组合满足下面条件,是不是就可以用greedy algorithm找最优解? : for each denomination, the denomination just smaller than it was a perfect : divisor of it. (i.e. 25 was a factor of 125; 5 was a factor of 25; 1 was a : factor of 5}. : http://tkramesh.wordpress.com/2011/03/09/greedy-algorithms-coin : 面试时要是碰到这个组合,直接跟面试官说it is proven that... so I will use : greedy algorithm instead of DP here,行不
|
h*******e 发帖数: 1377 | 3 应该给一个1 dime 就好了
【在 w****x 的大作中提到】 : : 满足这些面额的确可以用greedy
|
a********e 发帖数: 15 | 4 我觉得如果给了这种你还不用greedy,那就是没有一点解决问题的sense了。。。 |