結果
問題 | No.41 貯金箱の溜息(EASY) |
ユーザー |
![]() |
提出日時 | 2024-11-07 00:00:54 |
言語 | Common Lisp (sbcl 2.5.0) |
結果 |
AC
|
実行時間 | 56 ms / 5,000 ms |
コード長 | 455 bytes |
コンパイル時間 | 775 ms |
コンパイル使用メモリ | 27,904 KB |
実行使用メモリ | 22,784 KB |
最終ジャッジ日時 | 2024-11-07 00:01:06 |
合計ジャッジ時間 | 1,357 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 07 NOV 2024 12:01:04 AM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.093
ソースコード
(defconstant +mod+ 1000000009)(defun main (&rest argv)(declare (ignorable argv))(let* ((query (read))(dp (make-array 100001 :initial-element 1)))(loop for i from 1 to 9 do(loop for j from i to 100000 do(setf (aref dp j) (+ (aref dp j) (aref dp (- j i)))(aref dp j) (mod (aref dp j) +mod+))))(dotimes (_ query)(format t "~d~%" (aref dp (floor (read) 111111))))))(main)