結果

問題 No.1374 Absolute Game
ユーザー gorugo30
提出日時 2021-02-05 21:43:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 197 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 82,320 KB
実行使用メモリ 86,144 KB
最終ジャッジ日時 2024-07-02 11:56:52
合計ジャッジ時間 2,615 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
C = list(map(int, input().split()))

C.sort()
x = sum(C[::2])
y = sum(C[1::2])
ans1 = abs(x) - abs(y)
C = C[::-1]
x = sum(C[::2])
y = sum(C[1::2])
print(max(ans1, abs(x) - abs(y)))
0