結果
問題 |
No.790 ちきんの括弧並べ
|
ユーザー |
![]() |
提出日時 | 2024-11-12 18:01:36 |
言語 | Common Lisp (sbcl 2.5.0) |
結果 |
AC
|
実行時間 | 14 ms / 2,000 ms |
コード長 | 465 bytes |
コンパイル時間 | 554 ms |
コンパイル使用メモリ | 29,312 KB |
実行使用メモリ | 22,016 KB |
最終ジャッジ日時 | 2024-11-12 18:01:39 |
合計ジャッジ時間 | 2,154 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 10 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 12 NOV 2024 06:01:36 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.168
ソースコード
(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)