結果
問題 | No.1374 Absolute Game |
ユーザー | linuxmetel |
提出日時 | 2021-02-05 22:48:47 |
言語 | Common Lisp (sbcl 2.3.8) |
結果 |
WA
|
実行時間 | - |
コード長 | 508 bytes |
コンパイル時間 | 1,310 ms |
コンパイル使用メモリ | 29,308 KB |
実行使用メモリ | 31,600 KB |
最終ジャッジ日時 | 2023-09-15 09:39:45 |
合計ジャッジ時間 | 4,702 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 8 ms
22,868 KB |
testcase_01 | AC | 10 ms
26,980 KB |
testcase_02 | AC | 9 ms
26,988 KB |
testcase_03 | AC | 8 ms
23,000 KB |
testcase_04 | AC | 9 ms
24,988 KB |
testcase_05 | AC | 9 ms
24,996 KB |
testcase_06 | AC | 9 ms
22,900 KB |
testcase_07 | AC | 8 ms
22,956 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 15 SEP 2023 09:39:40 AM): ; processing (DEFVAR N ...) ; processing (DEFVAR C ...) ; processing (DEFVAR S ...) ; processing (DEFVAR B ...) ; processing (PRINC (IF # ...)) ; processing (FRESH-LINE) ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.186
ソースコード
(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)