The algorithm I want to implement is fairly simple - it's a basic change 
making problem: "given the following coins [20 coins with integer-values 
between 1 and 50] how many ways is there to combine them to get a total 
value of 150? two coins with equal value contribute one time each to a 
combination involving only one of them."

My approach was based on this SO answer 
<http://stackoverflow.com/a/14993011/38055>, basically figuring it out 
based on how many ways there are to get a total value of 150-x from the 
list of all coins except x. I might be able to remove and re-insert the 
value, but ordering is important (since I'll loop over the values, and I 
only want to test each value once on each level).

I'll have to think about this some more, but at least now I know that my 
naïve approach is impossible to optimize regardless of my inability to 
construct the indexing array efficiently :)

Thanks!

// T

On Monday, December 21, 2015 at 6:57:39 PM UTC+1, Tero Frondelius wrote:
>
> Hi
> Can you use a macro to produce your twenty nested loops? 

Reply via email to