結果

問題 No.1374 Absolute Game
ユーザー Kiri8128Kiri8128
提出日時 2021-02-05 22:48:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 118 ms / 2,000 ms
コード長 255 bytes
コンパイル時間 561 ms
コンパイル使用メモリ 86,680 KB
実行使用メモリ 93,360 KB
最終ジャッジ日時 2023-09-15 09:39:55
合計ジャッジ時間 4,602 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,092 KB
testcase_01 AC 74 ms
71,068 KB
testcase_02 AC 71 ms
71,084 KB
testcase_03 AC 73 ms
71,220 KB
testcase_04 AC 74 ms
71,144 KB
testcase_05 AC 73 ms
71,112 KB
testcase_06 AC 72 ms
70,868 KB
testcase_07 AC 73 ms
71,284 KB
testcase_08 AC 88 ms
78,652 KB
testcase_09 AC 107 ms
88,736 KB
testcase_10 AC 111 ms
90,760 KB
testcase_11 AC 97 ms
84,012 KB
testcase_12 AC 88 ms
79,300 KB
testcase_13 AC 102 ms
86,812 KB
testcase_14 AC 118 ms
92,988 KB
testcase_15 AC 117 ms
92,896 KB
testcase_16 AC 118 ms
93,168 KB
testcase_17 AC 116 ms
92,884 KB
testcase_18 AC 116 ms
92,736 KB
testcase_19 AC 117 ms
93,360 KB
testcase_20 AC 93 ms
81,100 KB
testcase_21 AC 95 ms
83,484 KB
testcase_22 AC 114 ms
92,712 KB
testcase_23 AC 80 ms
75,652 KB
testcase_24 AC 80 ms
75,660 KB
testcase_25 AC 83 ms
77,128 KB
testcase_26 AC 89 ms
79,492 KB
testcase_27 AC 97 ms
83,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = sorted([int(a) for a in input().split()])
x1 = - sum(A[::2]) - sum(A[1::2])
x2 = - sum(A[::2]) + sum(A[1::2])
x3 = sum(A[::-1][::2]) + sum(A[::-1][1::2])
x4 = sum(A[::-1][::2]) - sum(A[::-1][1::2])
print(max(min(x1, x2), min(x3, x4)))
0