結果

問題 No.185 和風
ユーザー まんしmaNNshi
提出日時 2025-03-29 21:00:57
言語 Common Lisp
(sbcl 2.5.0)
結果
AC  
実行時間 12 ms / 1,000 ms
コード長 611 bytes
コンパイル時間 205 ms
コンパイル使用メモリ 33,360 KB
実行使用メモリ 24,268 KB
最終ジャッジ日時 2025-03-29 21:00:59
合計ジャッジ時間 1,091 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 29 MAR 2025 09:00:57 PM):

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

ソースコード

diff #

(defvar N)
(setq N (parse-integer (read-line)))
(defvar X)
(defvar Y)

(defvar temp)
(setq temp (read-line))
(setq temp (read-from-string (concatenate 'string "(" temp ")" )))
(setq X (nth 0 temp))
(setq Y (nth 1 temp))

;(print X)
;(print Y)
(defvar ans)
(setq ans (- Y X))
(if (<= ans 0) (progn (format t "-1~%") (quit)))

(loop for i from 2 to N do
        (setq temp (read-line))
        (setq temp (read-from-string (concatenate 'string "(" temp ")" )))
        (setq X (nth 0 temp))
        (setq Y (nth 1 temp))
        (if (not (= (- Y X) ans))  (progn (format t "-1~%") (quit)))
)
(format t "~d~%" ans)
0