Re: [Haskell-cafe] Re: xkcd #287 NP-Complete

2007-07-19 Thread Hugh Perkins
Thank-you for the explanation :-) You make it very easy to understand, awesome :-) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Re: xkcd #287 NP-Complete

2007-07-17 Thread haskell
Hugh Perkins wrote: Your solution looks really elegant, and runs insanely fast. Can you explain how it works? I will jump in and explain, using a more finely named version: xkcd_c287' = foldr (\cost without - let (poor, rich) = splitAt cost without with

Re: [Haskell-cafe] Re: xkcd #287 NP-Complete

2007-07-16 Thread Hugh Perkins
On 7/16/07, Chung-chieh Shan [EMAIL PROTECTED] wrote: Here's my solution to the xkcd problem (yay infinite lists): dynamic programming? Cool :-) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Re: xkcd #287 NP-Complete

2007-07-16 Thread Hugh Perkins
Your solution looks really elegant, and runs insanely fast. Can you explain how it works? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Re: xkcd #287 NP-Complete

2007-07-16 Thread apfelmus
Tom Pledger wrote: We've seen some nice concise solutions that can deal with the original problem: solve 1505 [215, 275, 335, 355, 420, 580] I'll be a nuisance and bring up this case: solve 150005 [2, 4, 150001] A more scalable solution is to use an explicit heap that brings

[Haskell-cafe] Re: xkcd #287 NP-Complete

2007-07-15 Thread Chung-chieh Shan
Tom Pledger [EMAIL PROTECTED] wrote in article [EMAIL PROTECTED] in gmane.comp.lang.haskell.cafe: We've seen some nice concise solutions that can deal with the original problem: solve 1505 [215, 275, 335, 355, 420, 580] I'll be a nuisance and bring up this case: solve 150005 [2,