aboutsummaryrefslogtreecommitdiff
path: root/test.lisp
blob: 8cfe4782305c6a8bba2cdab862b6a11ee0e6646f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
;; Common Lisp

(require '#:package-locks)
(ext:without-package-locks
    (defun gcd (a b)
        (if (> b 0) (gcd b (mod a b)) a)
    )
)

(princ "test")

(setq N 1000)

(setq A ())
(loop for i from 0 to (- N 1)
    do (setq A (append A (list i)))
)

(setq ans 0)
(loop for i in A
    do (loop for j in A
        do (setq ans (+ ans (gcd i j)))
    )
)
(print ans)