3 / 3
Aug 2005

I am getting WA on SIZECON with Lisp. First, my current attempt(s):

(loop for i from 1 to (read)
when (> (setf tmp (read)) 0) sum tmp)

(let ((x 0) tmp)
(dotimes (i (read) x)
(if (> (setf tmp (read)) 0) (setf x (+ x tmp)))))

Both of these work correctly as far as I can tell on my machine, but don't work on the judge. If I am doing something obviously wrong, let me know.

I am using CLISP 2.34 on my computer.

  • created

    Aug '05
  • last reply

    Aug '05
  • 2

    replies

  • 217

    views

  • 2

    users

Er, I think you're supposed to print the solution.

blink blink

blush

I was running it in the REPL, so the return value was being printed.
I saw the return value, so I didn't think to print it. unamused

Thank you for catching my simple mistake. AC now.