3 ms·
But, but, the product of four prices cannot possible be measured in $. You must mean $^4. Edit: Here's a solution in Haskell. I've been paid to program in both
by bloak 8y ago
But, but, the product of four prices cannot possible be measured in $. You must mean $^4.
Edit: Here's a solution in Haskell. I've been paid to program in both Prolog and Haskell, but it was a while ago; my knowledge of both languages is very rusty.
main = putStrLn $ show [(a, b, c, d) | a <- [1..711], b <- [a + 1..711],
c <- [b + 1..711], d <- [711 - a - b - c], c <= d, a * b * c * d == 711000000]
- tonyg 8y agoAmazingly, this gives an answer within not too many tens of seconds of full CPU usage. (I interrupted it before it finished searching the full space, though.)
- deleted 8y ago[deleted]