結果
| 問題 |
No.2880 Max Sigma Mod
|
| コンテスト | |
| ユーザー |
Common Lisp
|
| 提出日時 | 2024-10-19 17:12:45 |
| 言語 | Common Lisp (sbcl 2.5.0) |
| 結果 |
AC
|
| 実行時間 | 35 ms / 3,000 ms |
| コード長 | 518 bytes |
| コンパイル時間 | 570 ms |
| コンパイル使用メモリ | 37,404 KB |
| 実行使用メモリ | 34,852 KB |
| 最終ジャッジ日時 | 2024-10-19 17:12:49 |
| 合計ジャッジ時間 | 3,286 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 48 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 19 OCT 2024 05:12:46 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.038
ソースコード
(defun main (&rest argv)
(declare (ignorable argv))
(let* ((n (read))
(m (read))
(xs (make-array (1+ n) :element-type 'integer :initial-element m))
(ys (make-array (1+ n) :element-type 'integer :initial-element 0)))
(loop for i from 1 to m
do (loop for j to n by i
do (setf (aref xs j) (- (aref xs j) i))))
(loop for i below n
do (setf (aref ys (1+ i)) (+ (aref ys i) (aref xs (1+ i)))))
(princ (reduce #'max ys))
(terpri)))
(main)
Common Lisp