Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Project Euler Problem 136
;gnu clisp 2 (defparameter n 1000000) (let ((sieve (make-array (list n) :element-type '(unsigned-byte 2) :initial-element 2))) (declaim (optimize (speed 3))) (loop for a fixnum from 3 by 6 for 3a2 fixnum = 3 then (+ 3a2 a) while (>= n 3a2) do (or (zerop (aref sieve 3a2)) (decf (aref sieve 3a2))) do (loop for r fixnum from 2 by 4 for 2r2 fixnum = 2 then (+ 2r2 r) for lim fixnum = (+ 2r2 3a2) while (<= lim n) do (or (zerop (aref sieve lim)) (decf (aref sieve lim))))) (pprint (count 1 sieve)) )
run
|
edit
|
history
|
help
0
removing null elements from the structure list
clisp macro for dummies
Вычисление гипотенузы... на лиспе.
КМ-01_Шолоп_1
93_Чух_1
Q5
ltk
Q1True
Sum of real numbers
Q1WorkInProgress