結果

問題 No.2835 Take and Flip
ユーザー Lisp_Coder
提出日時 2024-08-09 23:15:12
言語 Common Lisp
(sbcl 2.5.0)
結果
WA  
実行時間 -
コード長 762 bytes
コンパイル時間 1,610 ms
コンパイル使用メモリ 27,904 KB
実行使用メモリ 46,336 KB
最終ジャッジ日時 2024-08-09 23:15:18
合計ジャッジ時間 4,084 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other AC * 1 TLE * 1 -- * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 09 AUG 2024 11:15:12 PM):

; wrote /home/judge/data/code/Main.fasl
; compilation finished in 0:00:00.029

ソースコード

diff #

#-swank
(unless (member :child-sbcl *features*)
  (quit
   :recklessly-p t
   :unix-status
   (process-exit-code
    (run-program *runtime-pathname*
                 `("--control-stack-size" "1024MB"
                   "--noinform" "--disable-ldb" "--lose-on-corruption" "--end-runtime-options"
                   "--eval" "(push :child-sbcl *features*)"
                   "--script" ,(namestring *load-pathname*))
                 :output t :error t :input t))))

(defun solve-game ()
  (let* ((n (read))
         (a (sort (loop for i from 1 to n collect (read)) #'>))
         (result 0))
    (loop for i from 0 below n do
      (if (evenp i)
          (incf result (nth i a))
          (decf result (nth i a))))
    (format t "~d~%" result)))

(solve-game)

0