結果
問題 | No.1374 Absolute Game |
ユーザー |
![]() |
提出日時 | 2021-02-05 22:48:29 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 78 ms / 2,000 ms |
コード長 | 255 bytes |
コンパイル時間 | 136 ms |
コンパイル使用メモリ | 82,200 KB |
実行使用メモリ | 84,864 KB |
最終ジャッジ日時 | 2024-07-02 13:38:14 |
合計ジャッジ時間 | 2,569 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 26 |
ソースコード
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)))