Skip to content

Instantly share code, notes, and snippets.

@plaster
Last active December 16, 2015 23:49
Show Gist options
  • Select an option

  • Save plaster/5516056 to your computer and use it in GitHub Desktop.

Select an option

Save plaster/5516056 to your computer and use it in GitHub Desktop.
Google Code Jam 2013 Round 1A Problem B solution core
(use srfi-42)
(define (dfs E0 E R vs)
(match vs
[ () 0]
[ (v . vs)
(max-ec (:range e 0 (+ E 1))
(+ (* v e)
(dfs E0
(min E0 (+ E R (- e)))
R
vs)))
]
))
(define (solve E R vs)
(dfs E E R vs))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment