Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:帮看看哪里有问题, 贪心调整不正确么?

Posted by wrong123 at 2005-12-31 00:07:09 on Problem 2581
In Reply To:帮看看哪里有问题, 贪心调整不正确么? Posted by:wrong123 at 2005-12-29 00:49:16
en,发现问题一个: 25分和10分有点问题。 如果每次都选取最大的25分,
一旦还有剩余的没有找开,那么就会对10分的选取有影响,因为假如
总合A的末位数字是5,而又没有完全用25分找开,那么对于25的贪婪
不能使用 A/25  而是要用 A/25 - 1, 这样保证剩下的钱的末位是0,
以便用10分的零钱找。 其余就没什么冲突了。

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator