| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
Re:请教一个问题:找零钱问题 贪心?动态规划?In Reply To:请教一个问题:找零钱问题 贪心?动态规划? Posted by:faen at 2007-01-29 11:12:29 > 一套钱币的硬币种类有四种,价值分别是:1 5 10 25, 要找出零钱价值为n, 问最少需要多少个硬币。 > 我知道这个可以贪心求解。 > 但是对于另一套硬币种类,假设有三种:1,10,25 ,那么如果要找出零钱30,则用贪心不能够求出最优解,这个时候应该用动态规划。 > 我想问的是,如果判断一套硬币系统,可以用贪心来求解 第二种应该也可以用贪心解决的,只不过不能太贪心 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator