結果
問題 | No.533 Mysterious Stairs |
ユーザー |
![]() |
提出日時 | 2024-11-08 13:30:14 |
言語 | Common Lisp (sbcl 2.5.0) |
結果 |
AC
|
実行時間 | 179 ms / 5,000 ms |
コード長 | 666 bytes |
コンパイル時間 | 1,553 ms |
コンパイル使用メモリ | 29,440 KB |
実行使用メモリ | 53,120 KB |
最終ジャッジ日時 | 2024-11-08 13:30:18 |
合計ジャッジ時間 | 3,721 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 08 NOV 2024 01:30:14 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.070
ソースコード
(defconstant +mod+ 1000000007)(defun main (&rest argv)(declare (ignorable argv))(let* ((n (read))(dp (make-array (list (1+ n) 4) :initial-element 0)))(setf (aref dp 0 0) 1)(loop for i from 1 to n do(loop for j from 1 below 4when (>= i j)do (dotimes (k 4)(when (/= j k)(incf (aref dp i j)(aref dp (- i j) k))))(setf (aref dp i j) (mod (aref dp i j) +mod+))))(format t "~d~%" (mod (loop for i from 0 below 4sum (aref dp n i)) +mod+))))(main)