結果

問題 No.185 和風
ユーザー まんしmaNNshi
提出日時 2025-03-29 20:58:05
言語 Common Lisp
(sbcl 2.5.0)
結果
WA  
実行時間 -
コード長 610 bytes
コンパイル時間 395 ms
コンパイル使用メモリ 28,800 KB
実行使用メモリ 22,124 KB
最終ジャッジ日時 2025-03-29 20:58:06
合計ジャッジ時間 1,273 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 29 MAR 2025 08:58:05 PM):

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

ソースコード

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