結果

問題 No.790 ちきんの括弧並べ
ユーザー Common Lisp
提出日時 2024-11-12 18:01:36
言語 Common Lisp
(sbcl 2.6.3)
コンパイル:
sbclc _filename_
実行:
sbcl --script Main.fasl
結果
AC  
実行時間 10 ms / 2,000 ms
コード長 465 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 239 ms
コンパイル使用メモリ 31,744 KB
実行使用メモリ 22,272 KB
最終ジャッジ日時 2026-05-09 13:49:05
合計ジャッジ時間 3,033 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 10
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 09 MAY 2026 01:48:59 PM):

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

ソースコード

diff #
raw source code

(defun main (&rest argv)
  (declare (ignorable argv))
  (let* ((dp (make-array (list 14 14) :element-type 'integer :initial-element 0))
         (n (read)))
    (setf (aref dp 0 0) 1)
    (loop for i from 1 to n do
          (loop for j to n do
                (if (>= j i)
                    (setf (aref dp i j) (+ (aref dp i (1- j)) (aref dp (1- i) j)))
                    (setf (aref dp i j) (aref dp (1- i) j)))))
    (format t "~d~%" (aref dp n n))))

(main)
0