結果

問題 No.657 テトラナッチ数列 Easy
ユーザー Common Lisp
提出日時 2024-11-02 19:21:15
言語 Common Lisp
(sbcl 2.6.9)
コンパイル:
sbclc _filename_
実行:
sbcl --script Main.fasl
結果
AC  
実行時間 46 ms / 2,000 ms
+ 245µs
コード長 576 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,055 ms
コンパイル使用メモリ 28,672 KB
実行使用メモリ 27,648 KB
最終ジャッジ日時 2026-10-29 19:06:42
合計ジャッジ時間 2,742 ms
ジャッジサーバーID
(参考情報)
judge7_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 29 OCT 2026 07:06:38 PM):

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

ソースコード

diff #
raw source code

(defun main (&rest argv)
  (declare (ignorable argv))
  (let* ((a (make-array 1000005 :element-type 'integer))
         (b (make-array 5 :element-type 'integer))
         (q (read)))
    (dotimes (i 4)
      (setf (aref a i) (floor i 3)
            (aref b i) (floor i 3)))
    (loop for i from 4 to 1000000
          do (setf (aref b 4) (mod (+ (aref b 0) (aref b 1) (aref b 2) (aref b 3)) 17))
             (setf (aref a i) (aref b 4))
             (dotimes (j 4) (setf (aref b j) (aref b (1+ j)))))
    (dotimes (_ q)
      (format t "~d~%" (aref a (1- (read)))))))

(main)
0