結果

問題 No.1374 Absolute Game
ユーザー NoneNone
提出日時 2021-04-10 16:53:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 116 ms / 2,000 ms
コード長 292 bytes
コンパイル時間 1,728 ms
コンパイル使用メモリ 86,492 KB
実行使用メモリ 95,168 KB
最終ジャッジ日時 2023-09-08 12:45:45
合計ジャッジ時間 4,981 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,176 KB
testcase_01 AC 71 ms
71,380 KB
testcase_02 AC 71 ms
71,272 KB
testcase_03 AC 71 ms
71,380 KB
testcase_04 AC 70 ms
71,272 KB
testcase_05 AC 72 ms
71,368 KB
testcase_06 AC 72 ms
70,964 KB
testcase_07 AC 70 ms
71,164 KB
testcase_08 AC 85 ms
78,596 KB
testcase_09 AC 106 ms
89,944 KB
testcase_10 AC 110 ms
92,072 KB
testcase_11 AC 95 ms
84,948 KB
testcase_12 AC 86 ms
79,356 KB
testcase_13 AC 100 ms
87,816 KB
testcase_14 AC 116 ms
94,948 KB
testcase_15 AC 116 ms
94,448 KB
testcase_16 AC 114 ms
95,168 KB
testcase_17 AC 113 ms
94,532 KB
testcase_18 AC 114 ms
94,896 KB
testcase_19 AC 114 ms
94,404 KB
testcase_20 AC 87 ms
81,304 KB
testcase_21 AC 92 ms
83,880 KB
testcase_22 AC 113 ms
94,572 KB
testcase_23 AC 77 ms
75,752 KB
testcase_24 AC 79 ms
75,988 KB
testcase_25 AC 80 ms
76,600 KB
testcase_26 AC 85 ms
79,152 KB
testcase_27 AC 94 ms
83,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
C=list(map(int, input().split()))
C.sort(reverse=True)
conj1=sum(C[::2])-sum(C[1::2])
conj2=sum(C[:(N-1)//2+1])+sum(C[(N-1)//2+1:])
C.sort()
conj3=-(sum(C[::2])-sum(C[1::2]))
conj4=-(sum(C[:(N-1)//2+1])+sum(C[(N-1)//2+1:]))
res=max(min(conj1,conj2),min(conj3,conj4))
print(res)
0