結果

問題 No.2835 Take and Flip
ユーザー Lisp_CoderLisp_Coder
提出日時 2024-08-09 23:10:09
言語 Common Lisp
(sbcl 2.3.8)
結果
WA  
実行時間 -
コード長 762 bytes
コンパイル時間 1,675 ms
コンパイル使用メモリ 33,384 KB
実行使用メモリ 60,128 KB
最終ジャッジ日時 2024-08-09 23:10:15
合計ジャッジ時間 5,728 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 16 ms
28,456 KB
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 09 AUG 2024 11:10:09 PM):

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

ソースコード

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)) #'>))
         (x 0)
         (y 0))
    (loop for i from 0 below n do
      (if (evenp i)
          (incf x (nth i a))
          (incf y (nth i a))))
    (format t "~d~%" (- x y))))

(solve-game)
0