結果
| 問題 |
No.657 テトラナッチ数列 Easy
|
| コンテスト | |
| ユーザー |
Common Lisp
|
| 提出日時 | 2024-11-02 19:21:15 |
| 言語 | Common Lisp (sbcl 2.5.0) |
| 結果 |
AC
|
| 実行時間 | 65 ms / 2,000 ms |
| コード長 | 576 bytes |
| コンパイル時間 | 528 ms |
| コンパイル使用メモリ | 39,680 KB |
| 実行使用メモリ | 38,928 KB |
| 最終ジャッジ日時 | 2024-11-02 19:21:18 |
| 合計ジャッジ時間 | 2,770 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 02 NOV 2024 07:21:15 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.010
ソースコード
(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