12-21-2003, 09:00 PM
Make an algorithm that, given a bunch of (n) random INTEGERs and two inputted (sp??) LONGs, where the sum of the LONGs equals the sum of the integers,
finds the combination of INTEGERs for each LONG that most closely approximate (or exactly equal) the LONG's individual values.
Example:
INTEGERS: 5 4 2 3 = 14
LONGs: 6 8
Solution:
4 2, 5 3
Most efficient (or, the one that actually works, if there is only one that works..) algorithm wins...
finds the combination of INTEGERs for each LONG that most closely approximate (or exactly equal) the LONG's individual values.
Example:
INTEGERS: 5 4 2 3 = 14
LONGs: 6 8
Solution:
4 2, 5 3
Most efficient (or, the one that actually works, if there is only one that works..) algorithm wins...
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Visit www.neobasic.net to see rubbish in all its finest.