結果
| 問題 |
No.790 ちきんの括弧並べ
|
| ユーザー |
Common Lisp
|
| 提出日時 | 2024-11-12 17:45:45 |
| 言語 | Common Lisp (sbcl 2.5.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 457 bytes |
| コンパイル時間 | 1,593 ms |
| コンパイル使用メモリ | 35,096 KB |
| 実行使用メモリ | 31,764 KB |
| 最終ジャッジ日時 | 2024-11-12 17:45:48 |
| 合計ジャッジ時間 | 2,519 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 10 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 12 NOV 2024 05:45:45 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.036
ソースコード
(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))))
Common Lisp