結果

問題 No.135 とりあえず1次元の問題
コンテスト
ユーザー まんしmaNNshi
提出日時 2025-04-16 23:11:36
言語 Common Lisp
(sbcl 2.6.9)
コンパイル:
sbclc _filename_
実行:
sbcl --script Main.fasl
結果
AC  
実行時間 53 ms / 5,000 ms
+ 819µs
コード長 484 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 163 ms
コンパイル使用メモリ 40,256 KB
実行使用メモリ 31,616 KB
最終ジャッジ日時 2026-10-11 11:49:44
合計ジャッジ時間 1,834 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 11 OCT 2026 11:49:41 AM):

; wrote /home/judge/data/code/Main.fasl
; compilation finished in 0:00:00.089

ソースコード

diff #
raw source code

(read-line)
(defparameter x (read-from-string (concatenate 'string "(" (read-line) ")" )))

;(print x)
(defparameter mae 0)
(defparameter ans 0)
(setf x (sort x #'<))
;(print x)
;(print (car x))

(if (= (length x) 1) (progn (format t "~d~%" ans) (quit)))
(setq mae (car x))
(setq x (cdr x))
(loop for i in x do
	;(format t "mae=~d ans=~d i=~d~%" mae ans i)

 	(setq ans (if (= (- i mae) 0) ans
			  (if (= ans 0) (- i mae ) (min ans (- i mae)))))
	(setq mae i)
)
(format t "~d~%" ans)
0