3 ms·
1) 39+525+7-8 also works if I understand the problem. 2) You can optimize using various number-theoretic principles -- checked division and subtraction 3) C++
by gbronner 7y ago
1) 39+525+7-8 also works if I understand the problem.
2) You can optimize using various number-theoretic principles -- checked division and subtraction
3) C++ is much much faster for this -- less than a second on my boxes.
Not sure where people get the idea of dynamic programming -- you can do some dynamic tree cutting (e.g. if you don't have enough operators to get to your target), but there's no real objective function here.