Skip to main content
Source Link
DarthGizka
  • 4.9k
  • 2
  • 30
  • 44

Kudos for comparing scores by way of cross-multiplication instead of doing divisions. :-)

You can shave another cycle from the total by doing the division whenever you assign a new best score. The test then becomes if (tastiness > best_score * distance), one less multiplication. Score updates are extremely rare, like 29 for trying 1,814,400 routes.