Last active
December 16, 2015 23:49
-
-
Save plaster/5516056 to your computer and use it in GitHub Desktop.
Google Code Jam 2013 Round 1A Problem B solution core
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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