結果
問題 | No.999 てん vs. ほむ |
ユーザー |
![]() |
提出日時 | 2024-11-02 21:13:00 |
言語 | Common Lisp (sbcl 2.5.0) |
結果 |
AC
|
実行時間 | 167 ms / 2,000 ms |
コード長 | 495 bytes |
コンパイル時間 | 205 ms |
コンパイル使用メモリ | 39,812 KB |
実行使用メモリ | 32,908 KB |
最終ジャッジ日時 | 2024-11-02 21:13:04 |
合計ジャッジ時間 | 4,561 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 20 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 02 NOV 2024 09:13:01 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.016
ソースコード
(defun main (&rest argv)(declare (ignorable argv))(let* ((n (read))(a (make-array 200005))(b (make-array n :initial-element 0)))(dotimes (i (* 2 n)) (setf (aref a i) (read)))(dotimes (i n) (setf (aref b i) (- (aref a (1+ (* 2 i))) (aref a (* 2 i)))))(loop with ans = (reduce #'+ b)with c = ansfor i below ndo (decf c (* 2 (aref b i)))(setq ans (max ans c))finally (format t "~d~%" ans))))(main)