diff --git a/lisp/ros/solution2.ros b/lisp/ros/solution2.ros index 59bfaf1..583e287 100755 --- a/lisp/ros/solution2.ros +++ b/lisp/ros/solution2.ros @@ -45,7 +45,7 @@ exec ros -Q -- "$0" "$@" (type (integer 0 62) len)) (let* ((total-combinations - (1- (ash 1 (the (integer 0 61) (- len 1)))))) + (1- (ash 1 (the (integer 0 62) len))))) (declare (type fixnum total-combinations)) (format t "~D~%" total-combinations) (loop for i from 0 to total-combinations do @@ -60,7 +60,7 @@ exec ros -Q -- "$0" "$@" (format t "ER: input parameters~%") (uiop:quit 1)) (progn - (let* ((len (length args)) + (let* ((len (- (length args) 1)) (target (parse-integer (first args))) (mask (make-array len :element-type 'fixnum :initial-element 0)) (numbers (coerce (mapcar #'parse-integer (rest args)) '(simple-array fixnum (*))))) diff --git a/lisp/solution2.lisp b/lisp/solution2.lisp index 8037f31..6dd6775 100644 --- a/lisp/solution2.lisp +++ b/lisp/solution2.lisp @@ -31,7 +31,7 @@ (type (integer 0 62) len)) (let* ((total-combinations - (1- (ash 1 (the (integer 0 61) (- len 1)))))) + (1- (ash 1 (the (integer 0 62) len 1))))) (declare (type fixnum total-combinations)) (format t "~D~%" total-combinations) (loop for i from 0 to total-combinations do @@ -46,7 +46,7 @@ (format t "ER: input parameters~%") (uiop:quit 1)) (progn - (let* ((len (length args)) + (let* ((len (- (length args) 1)) (target (parse-integer (first args))) (mask (make-array len :element-type 'fixnum :initial-element 0)) (numbers (coerce (mapcar #'parse-integer (rest args)) '(simple-array fixnum (*)))))