結果
| 問題 |
No.135 とりあえず1次元の問題
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-04-16 22:51:00 |
| 言語 | Common Lisp (sbcl 2.5.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 436 bytes |
| コンパイル時間 | 1,624 ms |
| コンパイル使用メモリ | 29,072 KB |
| 実行使用メモリ | 36,520 KB |
| 最終ジャッジ日時 | 2025-04-16 22:51:04 |
| 合計ジャッジ時間 | 3,809 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 16 WA * 6 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 16 APR 2025 10:51:00 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.042
ソースコード
(read-line)
(defparameter x (read-from-string (concatenate 'string "(" (read-line) ")" )))
(defparameter mae 0)
(defparameter ans 0)
(sort 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)