結果
| 問題 | No.657 テトラナッチ数列 Easy |
| コンテスト | |
| ユーザー |
Common Lisp
|
| 提出日時 | 2024-11-02 19:21:15 |
| 言語 | Common Lisp (sbcl 2.6.3) |
| 結果 |
AC
|
| 実行時間 | 32 ms / 2,000 ms |
| コード長 | 576 bytes |
| 記録 | |
| コンパイル時間 | 140 ms |
| コンパイル使用メモリ | 39,432 KB |
| 実行使用メモリ | 30,336 KB |
| 最終ジャッジ日時 | 2026-05-06 01:57:05 |
| 合計ジャッジ時間 | 1,527 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 06 MAY 2026 01:57:02 AM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.008
ソースコード
(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)
Common Lisp