Discussion topic: i disagree with the answer of this question
Viewing messages
To go to the homepage of this topic, click here.
Page 1 of 1  From: raydzhao  Reply 1 of 1  Reply   Subject: i disagree with the answer of this question  it should be 1 less than whatever the algorithm produces. here is my
solution, assume dollar amount is X
The largest bag should have X/2 rounded up to the nearest dollar, the second
largest bag should be at least half of the remaining amount, and so on...
to prove it, look at it from bottom up: the last bag must have 1, and second
last bag have 2... its too much to type in this text box, think about it... Posted at: Fri Apr 3 02:52:31 2009 (GMT)

Page 1 of 1


To post to this forum, you must be signed in as a Syvum member.
Please sign in / register as a member.