結果
| 問題 |
No.40 多項式の割り算
|
| コンテスト | |
| ユーザー |
Common Lisp
|
| 提出日時 | 2024-11-10 20:33:43 |
| 言語 | Common Lisp (sbcl 2.5.0) |
| 結果 |
AC
|
| 実行時間 | 9 ms / 5,000 ms |
| コード長 | 581 bytes |
| コンパイル時間 | 339 ms |
| コンパイル使用メモリ | 30,080 KB |
| 実行使用メモリ | 21,760 KB |
| 最終ジャッジ日時 | 2024-11-10 20:33:46 |
| 合計ジャッジ時間 | 2,539 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 32 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 10 NOV 2024 08:33:43 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.018
ソースコード
(defun main (&rest argv)
(declare (ignorable argv))
(let* ((d (read))
(a (make-array (1+ d) :element-type 'integer))
(b 0))
(dotimes (i (1+ d)) (setf (aref a i) (read)))
(loop for i from (- d 3) downto 0 do
(setf (aref a (1+ i)) (+ (aref a (1+ i)) (aref a (+ i 3)))
(aref a (+ 3 i)) 0))
(dotimes (i (1+ d))
(unless (zerop (aref a i))
(setq b i)))
(format t "~d~%" b)
(dotimes (i (1+ b))
(if (= i b)
(format t "~d~%" (aref a i))
(format t "~d " (aref a i))))))
(main)
Common Lisp