4 ms·
> 100 = 3*4*...*50*50*...99 You can’t replace 2*100 with 50, it has to be 4*50. But there’s no reason you have to divide by 2 at all - why not replace 2*99 wit
by pansa2 2y ago
> 100 = 3*4*...*50*50*...99
You can’t replace 2*100 with 50, it has to be 4*50. But there’s no reason you have to divide by 2 at all - why not replace 2*99 with 6*33?
- SJC_Hacker 2y agoThanks, I've fixed the idea The basic idea is to "pair" the lowest numbers with the highest ones - sort of pushing everything towards the middle values Like I said, its naive greedy and non-optimal - otherwise time would be linear.