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