結果

問題 No.627 ランダムウォークの軌跡
ユーザー Common Lisp
提出日時 2024-10-11 18:09:16
言語 Common Lisp
(sbcl 2.5.0)
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 485 bytes
コンパイル時間 159 ms
コンパイル使用メモリ 35,244 KB
実行使用メモリ 22,144 KB
最終ジャッジ日時 2024-10-11 18:09:18
合計ジャッジ時間 1,785 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 11 OCT 2024 06:09:16 PM):

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

ソースコード

diff #

(defun main (&rest argv)
  (declare (ignorable argv))
  (let* ((n (read))
         (xs (loop repeat n collect (read)))
         (ans 'T))
    (if (and (/= (car xs) 1) (/= (car xs) -1))
        (setq ans 'F)
        (loop for x on xs
                     while (< 1 (length x))
                     as a = (car x)
                     as b = (cadr x)
                     when (/= (abs (- a b)) 1)
                       do (setq ans 'F) (return)))
    (princ ans)
    (terpri)))
(main)
0