結果
| 問題 | No.1374 Absolute Game |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-02-05 22:48:47 |
| 言語 | Common Lisp (sbcl 2.5.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 508 bytes |
| 記録 | |
| コンパイル時間 | 1,227 ms |
| コンパイル使用メモリ | 28,160 KB |
| 実行使用メモリ | 24,960 KB |
| 最終ジャッジ日時 | 2024-07-02 13:38:11 |
| 合計ジャッジ時間 | 2,711 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 6 WA * 20 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 02 JUL 2024 01:38:06 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.062
ソースコード
(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)