Guest User

Untitled

a guest
Jul 22nd, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. ; アルゴリズムパズル 2
  2.  
  3. (defun solve-2-a (xs)
  4. (1+ (apply #'+ xs)))
  5.  
  6. (defun solve-2-b (xs)
  7. (let*(
  8. (ys (sort xs #'<))
  9. (min-val (first ys))
  10. (rest-ys (rest ys)))
  11. (+ (* 2 (apply #'+ rest-ys)) 1 min-val)))
  12.  
  13. (print (solve-2-a '(2 3 5)))
  14. (print (solve-2-b '(2 3 5)))
Add Comment
Please, Sign In to add comment