結果
問題 |
No.2835 Take and Flip
|
ユーザー |
|
提出日時 | 2024-08-09 23:20:23 |
言語 | Common Lisp (sbcl 2.5.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 762 bytes |
コンパイル時間 | 177 ms |
コンパイル使用メモリ | 35,520 KB |
実行使用メモリ | 62,560 KB |
最終ジャッジ日時 | 2024-08-09 23:20:28 |
合計ジャッジ時間 | 4,106 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | AC * 1 TLE * 1 -- * 20 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 09 AUG 2024 11:20:23 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.008
ソースコード
#-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)