Consider a function f(left, start) which returns the minimized cost to make left more sets starting from index start.
In this function, of course if left is 0, then the cost is zero since we don't need to make any set. Also, make sure you catch early if it's even possible to make left sets starting from start. If not possible, return an infinite number as a result. Then, the rest is either you use start as the shortest chopstick, or you skip it! Naturally, you take the smaller of those two. I hope it doesn't take away the fun ... I think this is more than a hint ... On 9/9/07, Terry <[EMAIL PROTECTED]> wrote: > > > hi, > Can someone give me hints/soln on this problem > http://acm.uva.es/p/v102/10271.html > > the number of chopsticks is (K+8)*3 , the badness is minimized if we > choose neighbours. How do we write the recurrence relation ? which > elements form the chopstick triplet. > > > > > -- Fear of the LORD is the beginning of knowledge (Proverbs 1:7) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---