結果

問題 No.1374 Absolute Game
コンテスト
ユーザー linuxmetel
提出日時 2021-02-05 22:48:47
言語 Common Lisp
(sbcl 2.6.3)
コンパイル:
sbclc _filename_
実行:
sbcl --script Main.fasl
結果
WA  
実行時間 -
コード長 508 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 681 ms
コンパイル使用メモリ 30,312 KB
実行使用メモリ 23,936 KB
最終ジャッジ日時 2026-03-23 21:46:14
合計ジャッジ時間 2,536 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 6 WA * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 23 MAR 2026 09:46:11 PM):

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

ソースコード

diff #
raw source code

(defvar n (read)) 

(defvar c (apply #'vector (sort (loop repeat n
                                      collect (read)) #'<))) 

(defvar s (loop for i from 0 to (1- (floor n 2))
                sum (aref c i))) 
(defvar b (loop for i from (ceiling n 2) to (1- n)
                sum (aref c i))) 

(princ (if (evenp n)
           (abs (- (abs s) (abs b))) 
           (max (abs (- (abs (+ s (aref c (floor n 2)))) (abs b)))
                (abs (- (abs (+ b (aref c (floor n 2)))) (abs s)))))) 
(fresh-line)
0