18 Apr
2015
18 Apr
'15
7:59 p.m.
Can someone tell me how I could have avoided or fixed this?
The trouble manifested as stack overflow on solving
https://code.google.com/codejam/contest/4224486/dashboard#s=p1
For efficiency, you'll probably need more cleverness in math than in Haskell. You can predict an approximate start time for the Nth customer's service from the average per-customer service time M, where 1/M = sum 1/M_k. Starting from that estimate, one can skip over almost the entire service simulation. Doug McIlroy