結果
| 問題 | No.2701 A cans -> B cans |
| コンテスト | |
| ユーザー |
Common Lisp
|
| 提出日時 | 2024-11-13 00:12:54 |
| 言語 | Common Lisp (sbcl 2.6.3) |
| 結果 |
AC
|
| 実行時間 | 215 ms / 1,000 ms |
| コード長 | 788 bytes |
| 記録 | |
| コンパイル時間 | 123 ms |
| コンパイル使用メモリ | 32,512 KB |
| 実行使用メモリ | 22,528 KB |
| 最終ジャッジ日時 | 2026-05-09 13:56:34 |
| 合計ジャッジ時間 | 12,558 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 6 |
| other | AC * 73 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 09 MAY 2026 01:56:21 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.052
ソースコード
(defun main (&rest argv)
(declare (ignorable argv))
(let* ((*read-default-float-format* 'double-float)
(n (read))
(m (read))
(dp (make-array (1+ m) :element-type 'integer :initial-element 0)))
(dotimes (_ n)
(let* ((a (read))
(b (read))
(c (read))
(d 0)
(e 0))
(dotimes (i m)
(incf e)
(when (>= e a)
(incf d b)
(incf e (- b a)))
(setf (aref dp (1+ i)) (max (aref dp (1+ i)) (* d c))))))
(loop for i from 1 to m do
(loop for j from 1 to (floor i 2) do
(setf (aref dp i) (max (aref dp i) (+ (aref dp j) (aref dp (- i j)))))))
(loop for i from 1 to m do (format t "~d~%" (aref dp i)))))
(main)
Common Lisp